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.

How to change the cell text color in the Grid at RunTime

Thread ID:

Created:

Updated:

Platform:

Replies:

45094 Jun 10,2006 11:36 AM Jun 13,2006 12:16 AM Windows Forms 3
loading
Tags: Grouping
Prashant Gangwar
Asked On June 10, 2006 11:36 AM

How to change the cell''s text color in the Syncfusion''s Datagrid at run time if the cell is edited?

Administrator [Syncfusion]
Replied On June 11, 2006 11:44 PM

Hi Prashant, Try this code in PrepareViewStyleInfo event. Here is a code snippet GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(e.ColIndex > 0 && e.RowIndex > 0 ) { if( e.ColIndex == cc.ColIndex && e.RowIndex == cc.RowIndex && cc.IsEditing ) { e.Style.TextColor = Color.Red; } } Letme know if this helps. Best Regards, Haneef

Prashant Gangwar
Replied On June 12, 2006 09:22 AM

Hi Haneef, Thanks for your quick response. ForSCAGroupingDataGrid we do not have PrepareViewStyleInfo event. What can we use in place of that event? Thanks and Regards Prashant

Administrator [Syncfusion]
Replied On June 13, 2006 12:16 AM

Hi Prashant , For grouping grid, you need to use the TableControlPrepareViewStyleInfo event. Here is a code snippet private void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e) { GridCurrentCell cc = e.TableControl.CurrentCell; if(e.Inner.ColIndex > 0 && e.Inner.RowIndex > 0 ) { if( e.Inner.ColIndex == cc.ColIndex && e.Inner.RowIndex == cc.RowIndex && cc.IsEditing ) { e.Inner.Style.TextColor = Color.Red; } } } Regards, Haneef

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.

;