GrapeCity.Win.MultiRow.v80 アセンブリ > GrapeCity.Win.MultiRow 名前空間 > Cell クラス : PerformVerticalAutoFit メソッド |
例外 | 解説 |
---|---|
System.InvalidOperationException | GcMultiRowプロパティがnull 参照 (Visual Basicでは Nothing)のときにこのメソッドが実行されました。 または または このセルが親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