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.

Expression not working as expected

Thread ID:

Created:

Updated:

Platform:

Replies:

72524 Mar 25,2008 09:10 AM Mar 25,2008 06:50 PM Windows Forms 1
loading
Tags: GridControl
Rohit Sharma
Asked On March 25, 2008 09:10 AM

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?


Administrator [Syncfusion]
Replied On March 25, 2008 06:50 PM

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



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.

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.

;