- Online Barcode Generator
- How To
- Buy Now
C# Data Types Converting for Grid Control
The DataGrid Controls for Windows Forms applications are an amazing component for design modern user interface. This cool control provides large flexibility to meet any critical requirements of applications nowadays. Furthermore, the DataGrid View control provides the .NET WinForms Data Type Converter to change the incompatible value types to supported ones.
Data Types Converting in C#
When we want to convert the data types, we can implement a custom data type converter class to control the Data Grid component to detect the types of data by using the Data Type Check Box Column. The following sample shows how to implement the toggle state converter c# class to convert the char values to toggle state values.
Apply Data Type Converters
When we apply the data type converters to Data Grid converting layer, we can use each of the two ways below. One is to apply the data type converters to generate the desired column and assign the data type property. The other is to add data type converters to use the DataTypeConverterAttribute specifying the Data TypeConverter. The following C# code shows how to apply the Data Type converters.
To add data type converters to use the DataTypeConverterAttribute specifying the Data TypeConverter, we need to apply the DataTypeConverterAttribute to the incompatible property of the business object as data source, which generate data grid check box column.
Null Values in Data Grid
When there are null values in your data source, the Kettic Data Grid Control conversation layer can handle them. It requires to specify the default value committed to data source to null. The C# code below demonstrates how to set the Data source null value.
UI Controlsfor Windows Forms.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls