We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to apply different styles for the specific column or row or cell in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl

Styles settings

In GridGroupingControl, specific styles for individual row, column and cells can be specified by using the QueryStyleCellInfo event. This event can be used to get or set every style properties of the grid. Any specified criteria of a row or column or cell can be applied with the style values.


// form ()
// Trigger the required event
this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
    // Sets a specified style for a row.
    if(e.TableCellIdentity.RowIndex == 7)
       e.Style.BackColor = Color.PaleGreen;
    // Sets a specified style for a column.
    if(e.TableCellIdentity.ColIndex == 3)
       e.Style.TextColor = Color.Red;
       e.Style.CellValueType = typeof(Int32);
    // Sets a specified style for a single cell.
    if(e.TableCellIdentity.RowIndex == 6 && e.TableCellIdentity.ColIndex == 2)
       e.Style.BackColor = Color.LightPink;
       e.Style.CellType = GridCellTypeName.ProgressBar;


' form () 
' Trigger the required event
AddHandler gridGroupingControl1.QueryCellStyleInfo, AddressOf gridGroupingControl1_QueryCellStyleInfo
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs)
   ' Sets a specified style for a row.
   If e.TableCellIdentity.RowIndex = 7 Then
       e.Style.BackColor = Color.PaleGreen
   End If
   ' Sets a specified style for a column.
   If e.TableCellIdentity.ColIndex = 3 Then
       e.Style.TextColor = Color.Red
       e.Style.CellValueType = GetType(Int32)
   End If
   ' Sets a specified style for a single cell.
   If e.TableCellIdentity.RowIndex = 6 AndAlso e.TableCellIdentity.ColIndex = 2 Then
       e.Style.BackColor = Color.LightPink
       e.Style.CellType = GridCellTypeName.ProgressBar
   End If
End Sub


Show the different style applied to GridGroupingControl


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile