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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl Background row

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hello,

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?

Thanks.



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.

Regards,
Mayavel K



CopyPasteTest1_cb97820f.zip

CONFIRMATION

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.

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

;