内容に基づいて行のサイズを変更します。このメソッドは、UltraGridOverride.RowSizing が Synchronized に解決される場合(デフォルト)は何もしません。このプロパティを Synchronized 以外の値に設定すると、期待通りに動作します。
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout ' PerformAutoSize is honored only for RowSizing of Free or AutoFree. ' Me.UltraGrid1.DisplayLayout.Override.RowSizing = RowSizing.Free Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0).CellMultiLine = DefaultableBoolean.True End Sub Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click Me.UltraGrid1.Rows(0).Cells(0).Value = "Long long" & vbCrLf & "multiline text" ' When the value of a cell is changed that qill require the height of the ' row to be adjusted, call PerformAutoSize to. ' Me.UltraGrid1.Rows(0).PerformAutoSize() End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // PerformAutoSize is honored only for RowSizing of Free or AutoFree and AutoFixed. // this.ultraGrid1.DisplayLayout.Override.RowSizing = RowSizing.Free; this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellMultiLine = DefaultableBoolean.True; } private void button1_Click(object sender, System.EventArgs e) { this.ultraGrid1.Rows[0].Cells[0].Value = "Long long\nmultiline text"; // When the value of a cell is changed that qill require the height of the // row to be adjusted, call PerformAutoSize to. // this.ultraGrid1.Rows[0].PerformAutoSize( ); }