Imports Infragistics.Win
Before you start writing any code, you should place using/imports directives in your code-behind so you don’t need to always type out a member’s fully qualified name.
In Visual Basic:
Imports Infragistics.Win
In C#:
using Infragistics.Win;
You must set the CellMultiLine property of the Column object to True.
In Visual Basic:
Me.UltraGrid1.DisplayLayout.Bands(0).Columns(1).CellMultiLine = DefaultableBoolean.True
In C#:
this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellMultiLine = DefaultableBoolean.True;
A natural implementation of the CellMultiLine property could be as follows by also setting the VertScrollBar property of the column to True.
In Visual Basic:
Me.UltraGrid1.DisplayLayout.Bands(0).Columns(1).VertScrollBar = True
In C#:
this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].VertScrollBar = true;
You may want to increase the DefaultRowHeight of the grid to better illustrate this sample.
In Visual Basic:
Me.UltraGrid1.DisplayLayout.Override.DefaultRowHeight = 100
In C#:
this.ultraGrid1.DisplayLayout.Override.DefaultRowHeight = 100;
Place the above snippets into the InitializeLayout event of the WinGrid™.
Run the project and type into a cell on column 1.
Press the enter key for a new line.
If the contents of the cell exceed the height of the row, you can use the vertical scroll bar to view the cell contents.