Resizes the row based on its contents.
Following code illustrates how to use PerformAutoSize method. RowSizing modes of AutoFree and AutoFixed automatically size the rows to fit their contents. Whenever the contents of a row are changed, UltraGrid will not automatically resize the row. To force the row to resize to fit its new contents, call PerformAutoSize on the row.
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
'Declaration
Public Sub PerformAutoSize()
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( );
}
'Declaration
Public Sub PerformAutoSize()
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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