Expression not working as expected

Hi,

I have defined an expression like "[Deleted] Like \'Y\'" to set the row's backcolor equal to green.

For some reason the color green shows up only when the original record set contains Deleted column with value 'Y' but not when I programatically update the Deleted column value
try
{
record.BeginEdit();
record.SetValue("Delted", "Y");
}finally
{
record.EndEdit();
}

Alternatively a deleted row shows up in green if i programatically add new row.

I am sure i am missing something but i have tried calling suspend/ResumeLayout, Refresh and Update but to no avail.

Can some one please give me some pointer on the same?


1 Reply

AD Administrator Syncfusion Team March 25, 2008 10:50 PM UTC

HiRohit,

Thank you for your patience.

If your intention is to highlight the record in green color, whose "deleted" column contains value "Y"(even though "Deleted column value change through coding), Please refer the code below.

this.gridGroupingControl1.TableOptions.SelectionBackColor = Color.Green;
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el.Kind == DisplayElementKind.Record)
{
Record rec = el.GetRecord();
if (rec.GetValue("Deleted").Equals('Y'))
{
rec.SetSelected(true);
}
}
}


Please let me know if this helps.

Regards,
Srirajan



Loader.
Up arrow icon