ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Enabling Wordwrap in Cells

By default, a grid cell displays a single line of text, truncated at the cell's right boundary. Display multiple lines of text in a cell by increasing the grid's RowHeight property and setting the WrapText property of the desired column’s Style object to True. If WrapText is True (the default is False), a line break occurs before words that would otherwise be partially displayed in a cell. The cell contents will continue to display on the next line, assuming that the grid's row height accommodates multiple lines.

Use the following loop to enable wordwrap for all grid columns:

·      Visual Basic

Dim C As C1.Win.C1TrueDBGrid.C1DisplayColumn

For Each C In Me.C1TrueDBGrid1.Splits(0).DisplayColumns

    C.Style.WrapText = True

Next

·      C#

C1.Win.C1trueDBGrid.C1DisplayColumn C ;

for each(C in this.C1trueDBGrid1.Splits[0].DisplayColumns)

{

    C.Style.WrapText = true ;

}

·      Delphi

var

  C: C1TrueDBGrid.C1DisplayColumn;

  i: Integer;

begin;

  for i := 0 to Self.C1TrueDBGrid1.Splits[0].DisplayColumns.Count-1 do

  begin

    C := Self.C1TrueDBGrid1.Splits[0].DisplayColumns[i];

    C.Style.WrapText := True;

  end;

end;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.