How to Set Data Type of Column in WinForms GridGroupingControl?
Data type of a column
By default,
the data type 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 in WinForms GridGroupingControl.
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)
The screenshot below illustrates the datatype column in GridGroupingControl.
Samples:
C#: DataType_CS
VB: DataType_VB
Conclusion
I hope you
enjoyed learning on how to set data type of a column in
GridGroupingControl.
You can refer
to the WinForms GridGroupingControl feature tour page to know about its
other groundbreaking feature representations and WinForms GridGroupingControl documentation, and how to quickly get started for
configuration specifications. You can also explore our WinForms GridGroupingControl example to understand how to create and
manipulate data.
For current
customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our
30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!