Create Custom GridView Cells in C#.NET
The Kettic DataGridView C#.NET component allows users of the control easily create custom grid cells to GridView in Windows Forms application. There are a lot of visual cells which all inherit from KetticGridCellElement are included in the DataGridView control, such as, header cells, indent cells, command cells, summary cells, group content cells, data cells, etc. All the visual cells are compatible with the usage of GridView component. So users can easily create custom grid cells when you need to implement more specific and custom scenario.
How to Create Custom Grid Cells in C#.NET
To create a custom grid data cell by using the Kettic GridView component, we can use the C# code as below, which creates a C# class for the gird cell derived from the KetticDataGridCellElement.
And then, we can create the KetticProgressBarElement for the custom grid data cells and add the progress bar as a child of the custom grid data cell. This is accomplished by override the method, CreateChildElements, by using the C# code as below.
After finishing the above step, we can update the progress bar for the custom grid data cells based on the value that are assigned by overriding the method, SetContentCore.
Now, we can simply style the custom grid cell by apply the style of KetticDataGridCellElement to it. This is achieved by defining the ThemeEffectiveType of the KetticDataGridCellElement style as the C# below.
For the convenience of users of control, the GridView allows users reuse the created custom grid data cells in C# Windows Forms projects. The created custom cells can also be used in different rows or columns when they are compatible with the custom cells, which can be defined through the ApplyCompatible property for columns. Extend the Custom Grid Cell in C#.NET
The Kettic GridView allows users of the control to extend the custom grid data cell by adding a button into the custom data cell and subscribing the custom cell to the Click event. And we can use the button to restart the progress bar by setting the custom cell value to 0. The following are the steps that shows how to achieve this.
|
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 - ColumnGridView - RowGridView - CellsCells - AccessCells - PropertyCells - IterateCells - Conditional FormatCells - Format CellsCells - Set CellsCells - Painting & DrawingCells - Custom CellsGridView - EditorsEditors - PropertyEditors - EventsEditors - Data ValidationEditors - CustomizeGridView - 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 |