Infragistics(R) NetAdvantage(R) Windows Forms
CellMultiLine Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridOverride Class : CellMultiLine Property

Determines if the cell's data should be displayed in a multi-line format.

Syntax

Visual Basic (Declaration) 
Public Property CellMultiLine As Infragistics.Win.DefaultableBoolean
C# 
public Infragistics.Win.DefaultableBoolean CellMultiLine {get; set;}

Example

Following code sets CellMultiLine property on various objects in the UltraGrid.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button33_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button33.Click

      ' Set the CellMultiLine on the layout's Override to True. All cells in the UltraGrid
      ' will be multiline.
      Me.UltraGrid1.DisplayLayout.Override.CellMultiLine = DefaultableBoolean.True

      ' You can override that grid-wide setting for a particular band by setting it on the
      ' override of that band.
      Me.UltraGrid1.DisplayLayout.Bands(0).Override.CellMultiLine = DefaultableBoolean.False

      ' You can also set CellMultiLine for a particular column so only cells in this
      ' column will be multiline.
      Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0).CellMultiLine = DefaultableBoolean.True

  End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button33_Click(object sender, System.EventArgs e)
{

	// Set the CellMultiLine on the layout's Override to True. All cells in the UltraGrid
	// will be multiline.
	this.ultraGrid1.DisplayLayout.Override.CellMultiLine = DefaultableBoolean.True;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.
	this.ultraGrid1.DisplayLayout.Bands[0].Override.CellMultiLine = DefaultableBoolean.False;

	// You can also set CellMultiLine for a particular column so only cells in this
	// column will be multiline.
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellMultiLine = DefaultableBoolean.True;

}

Remarks

This property controls the display of multiple lines of text in edit cells in the band or the grid controlled by the specified override. When True, text will wrap in the area of the cell. If the RowSizing property is set to automatically resize the row, the row will expand in height until all lines of text are displayed (or the number of lines specified by the RowSizingAutoMaxLines property is reached).

The CellMultiLine property does not pertain to multi-line editing, only display. Also, you should note that setting a cell to multi-line mode will disable data masking. Only single-line cells can be masked (using the MaskInput and MaskDisplayMode properties.)

See Also