Articles in this section
Category / Section

How to set the data type of a column in a WinForms GridGroupingControl?

2 mins read

Data type of a column

By default, the data tyle for each columns will be assigned directly from the Datasource. For example, if the DataTable is populated with the below data, the corresponding column will be integer column.

C#

DataColumn datacolumn;
dc.DataType = typeof(int);

VB

Dim dc As DataxColumn 
dc.DataType = GetType(Integer)

But the data type for any column can be changed manually using CellValueType property.

C#

GridColumnDescriptor columndescriptor = new GridColumnDescriptor("Column_Name");            columndescriptor.Appearance.AnyCell.CellValueType = typeof(double);

 

VB

Dim desc As New GridColumnDescriptor("Id")
desc.Appearance.AnyCell.CellValueType = GetType(Double)

 

Screenshot

change the data type to integer

Samples:

C#: DataType_CS

VB: DataType_VB

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied