$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
DataGridView for C#.NET WinForms
Create custom data grid cells to GirdView in C# for your .NET Windows Forms applications
Home > WinForms UI Controls > User Manual > Custom Grid Cells in C#

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.

public class ProgressBarCellElement : KetticDataGridCellElement

public ProgressBarCellElement(GridViewColumn column, GridRowElement row)
: base(column, row)
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.

private KetticProgressBarElement ketticProgressBarElement;

protected override void CreateChildElements()

ketticProgressBarElement = new KetticProgressBarElement();
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.

protected override void SetContentCore(object value)
if (this.Value != null && this.Value != DBNull.Value)
this.ketticProgressBarElement.Value1 = (int)this.Value;
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.

protected override Type ThemeEffectiveType
return typeof(GridDataCellElement);

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.
  1. C# code for initializing the button elements and add the elements to the grid cell that will be customized.
  2. And then, we can arrange the child elements of the grid data cell by overriding the ArrangeOverride method as C# code below.
  3. Finally, we can handle the Click event of Kettic ButtonElement with the following C# code.
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