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.

GridGroupingControl change cell color after edit complete

Thread ID:

Created:

Updated:

Platform:

Replies:

73211 Apr 24,2008 01:14 PM May 5,2008 04:02 AM Windows Forms 1
loading
Tags: GridControl
Mehul Doshi
Asked On April 24, 2008 01:14 PM

For a GridGroupingControl, after a cell value has been changed, I wish to then change the BackColor of that cell. I'm using the TableControlCellAcceptedChanges event, but
grid.TableModel[rowIndex, colIndex].BackColor = Color.Red; does not seem to have any effect.

Can someone tell me how I can accomplish this?


Jisha Joy [Syncfusion]
Replied On May 5, 2008 04:02 AM

Hi,


This can be achieved by handling the QueryCellStyleInfo event. Please use the follwing code snippets and let me know if this helps.

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el.Kind == Syncfusion.Grouping.DisplayElementKind.Record)
{
Record rec = el.GetRecord();
if (rec != null)
{
DataRowView row = rec.GetData() as DataRowView;
if (row != null & row.Row.RowState == DataRowState.Modified)
{
e.Style.BackColor = Color.Pink;
}
}
}

}


Regards,
Jisha


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.

;