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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I conditionally set the style of a row depending upon the values in a row in the GridGroupingControl?

Formatting of a row can be applied through either Conditional Formatting or by using QueryCellStyleInfo event in the GridGroupingControl.

Conditional Formatting

To conditionally set the style of a row in the GridGroupingControl, you can apply the row styles by using the Conditional Formatting function. You can refer to the following code example to apply Conditional Formatting to the records that have the cell value of Row1.

C#

VB

 

The following screenshot displays the Conditional Formatting applied to the GridGroupingControl.

 

 

 

QueryCellStyleInfo event

To dynamically set the style properties on a cell, the QueryCellStyleInfo event has to be handled. You can access the row of the cell and check whether it is a RecordRow or not. Assuming the datasource as a DataTable, the GridRecordRow.Record.GetData method returns the data as a DataRowView object. Then by using the DataRowView, you can access the data in the row and after checking the conditions, change the style of the row. Refer to the following code example.

C#

 

VB

 

Sample Links

ConditionalRowStyle-C#

ConditionalRowStyle-VB

Article ID: Published Date: Last Revised Date: Platform: Control:
637 04/30/2011 03/04/2015 WinForms GridGroupingControl
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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