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 DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlGridView - Get Started in C#GridView - PropertiesGridView - ColumnColumn - TypesData ColumnBrowse ColumnCalculator ColumnCheckBox ColumnColor ColumnComboBox ColumnCommand ColumnDataTime ColumnDecimal ColumnHyperLink ColumnImage ColumnMaskBox ColumnMultiComboBox ColumnTextBox ColumnColumn - Generating ColumnsAccess & Iterate through ColumnsColumn - ReorderColumn - ResizeColumn - Pin & UnpinColumn - Column ChooserColumn - Data FormattingColumn - Convert Data TypesGridView - RowGridView - CellsGridView - EditorsGridView - Context MenuGridView - Populating with DataGridView - Hierarchical GridGridView - SelectionGridView - ScrollingGridView - SortingGridView - GroupingGridView - FilteringGridView - Expression EditorInsert/ Update/ Delete RecordsGridView - View DefinitionGridView - Exporting DataStyling and AppearanceGridView - LocalizationSave and Load LayoutGridView - Print SupportWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |