row background color based on ds criteria

Is there a way to set the background of a row in a datagrid based on a criteria in the datasource at runtime? Let say, i want to color all rows with "updated" column value = true to blue. How can I accomplish this?

3 Replies

AD Administrator Syncfusion Team March 18, 2005 04:16 PM UTC

Here is a KB discussing how to go about this. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=84&catId=11 In your PrepareViewStyleInfo, you would need to check your criteria based on e.RowIndex and e.ColIndex, and then conditionally set e.Style.BackColor.


FH Faraz Haque March 19, 2005 12:02 AM UTC

Thanks..thats works for me.. Does the same apply to grouping grid? >Here is a KB discussing how to go about this. >http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=84&catId=11 > >In your PrepareViewStyleInfo, you would need to check your criteria based on e.RowIndex and e.ColIndex, and then conditionally set e.Style.BackColor.


AD Administrator Syncfusion Team March 19, 2005 01:32 AM UTC

With a groupinggrid, you can probably use ConditionalFormats. These are discussed in this forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=19910

Loader.
Up arrow icon