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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

45094 Jun 10,2006 03:36 PM UTC Jun 13,2006 04:16 AM UTC WinForms 3
loading
Tags: Grouping
Prashant Gangwar
Asked On June 10, 2006 03:36 PM UTC

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 12, 2006 03:44 AM UTC

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 01:22 PM UTC

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 04:16 AM UTC

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.

Warning Icon 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.Close Icon

;