A newer version of this page is available.
Switch to the current version.
GridColumn.ColumnType Property
Gets the column's data type.
Namespace: DevExpress.XtraGrid.Columns
Assembly: DevExpress.XtraGrid.v19.1.dll
Declaration
[Browsable(false)]
public virtual Type ColumnType { get; }
<Browsable(False)>
Public Overridable ReadOnly Property ColumnType As Type
Property Value
Type | Description |
---|---|
Type | A System.Type value representing column data type. |
Remarks
The code sample below illustrates how to highlight all DateTime columns in a grid.
gridView1.CustomDrawCell += GridView1_CustomDrawCell;
private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
{
GridView view = sender as GridView;
if (column.ColumnType == typeof(DateTime))
{
e.Cache.FillRectangle(Color.Salmon, e.Bounds);
e.Appearance.DrawString(e.Cache, e.DisplayText, e.Bounds);
e.Handled = true;
}
}
See Also
Feedback