GrapeCity.Win.MultiRow Namespace > Cell Class : PerformHorizontalAutoFit Method |
Public Sub PerformHorizontalAutoFit()
Dim instance As Cell instance.PerformHorizontalAutoFit()
public void PerformHorizontalAutoFit()
Exception | Description |
---|---|
System.InvalidOperationException | Executes this method when the GcMultiRow property is a null reference (Nothing in Visual Basic). -or- -or- This cell is beyond the boundary of the parent Section. |
void autoFitAllColumns_Click(object sender, EventArgs e) { for (int i = 0; i < this.gcMultiRow1.ColumnHeaders[0].Cells.Count; i++) { Cell cell = this.gcMultiRow1.ColumnHeaders[0][i]; // Auto change cell's width to fit cells contents. cell.PerformHorizontalAutoFit(); } } void autoFitAllRows_Click(object sender, EventArgs e) { for (int i = 0; i < this.gcMultiRow1.RowCount; i++) { Cell cell = this.gcMultiRow1.Rows[i][0]; // Auto change cell's height to fit cells contents. cell.PerformVerticalAutoFit(); } }
Private Sub autoFitAllColumns_Click(ByVal sender As Object, ByVal e As EventArgs) Handles autoFitAllColumns.Click For i As Integer = 0 To Me.gcMultiRow1.ColumnHeaders(0).Cells.Count - 1 Dim cell As Cell = Me.gcMultiRow1.ColumnHeaders(0)(i) ' Auto change cell's width to fit cells contents. cell.PerformHorizontalAutoFit() Next End Sub Private Sub autoFitAllRows_Click(ByVal sender As Object, ByVal e As EventArgs) Handles autoFitAllRows.Click For i As Integer = 0 To Me.gcMultiRow1.RowCount - 1 Dim cell As Cell = Me.gcMultiRow1.Rows(i)(0) ' Auto change cell's height to fit cells contents. cell.PerformVerticalAutoFit() Next End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2