Gets or sets the maximum number of characters which may be entered for cells in this column.
[Visual Basic]
Public Property DataWidth As Integer
[C#]
public int DataWidth {get;set;}
[Delphi]
public property DataWidth: Int32 read get_DataWidth write set_DataWidth;
Remarks
This property holds the database width, in bytes, for a grid column. It is set to the appropriate field width (not display width) automatically when the layout of a bound grid is initialized at run time.
This property does not affect the physical size of a column, but imposes a limit on the number of characters that may be entered when editing a cell. If set to 0, no such limits are imposed. Setting this property does not cause truncation of existing data.
Example
The following code uses the DataWidth property to limit the number of characters the user can enter:
Me.C1TrueDBGrid1.Columns(0).DataWidth = 20
· C#
this.c1TrueDBGrid1.Columns[0].DataWidth = 20;
· Delphi
Self.C1TrueDBGrid1.Columns[0].DataWidth := 20;
See Also
C1DataColumn Class | C1DataColumn Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |