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

GridDataControl Background row

Thread ID:





98774 Mar 29,2011 01:57 PM UTC Mar 31,2011 02:01 PM UTC WPF 1
Tags: GridControl
Jorge Pampin
Asked On March 29, 2011 01:57 PM UTC


I have implemented this code to set Background row in function of a row value:

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
if (e.Cell.RowIndex > 0 && e.Cell.RowIndex < model.RowCount - Grid.TableSummaryRows.Count)
DataRow Fila = null;
Fila = ((DataRowView)model.Table.GetRecordFromRow(e.Cell.RowIndex)).Row;

if ((int)Fila["Value"] == 1)
e.Style.Background = Brushes.LightCoral;
else if ((int)Fila["Value"] == 2)
e.Style.Background = Brushes.LightCyan;

But, this doesn't work when there are grouping columns. How to modify the code to do that code works with grouping columns too?


Mayavel K [Syncfusion]
Replied On March 31, 2011 02:01 PM UTC

Hi Jorge,

We have attached the sample that helps you achieve your requirement.

Please check the sample and let us know if you need any further assistance on this.

Mayavel K



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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