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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set specify column header''s Foreground color?

Thread ID:





89911 Sep 10,2009 09:43 AM UTC Sep 14,2009 09:37 AM UTC WPF 5
Tags: GridControl
Asked On September 10, 2009 09:43 AM UTC

I know set ColumnHeaderStyle's Foreground can set all column header's foreground color.
I want to set specify column header's foreground color,how to do it?

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 10, 2009 09:56 AM UTC


You can access individual style through the Model[x,y] and set the property. For setting a specific column style, you can use the following,

this.grid.Model[0,1].Foreground = Brushes.Red;


Replied On September 11, 2009 09:57 AM UTC

Thanks for replay.I place the statement at Loaded event's response function,the color correctly be set,but if I do any operate at control e.g. click,the color disappeared.
If I place the statement at LayoutUpdated event's response function,after operate the color not disappear but the window strong blink.
How can solve it?I need help.

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 14, 2009 06:33 AM UTC


Is it possible for you to attach the sample with the issue? I am not able to reproduce it,


You may also want to use the PrepareRenderCell event to set the foreground/background of a cell if you have refreshes happening quite fast.

Please let me know.


Replied On September 14, 2009 07:21 AM UTC

I'm sorry I didn't say it clear,The control I used is GridTreeControl ,not GridControl.
The source attached here,All I did was add treeGrid_Loaded function at the last base on example ExpandCellLook.
P.S.I'm not found PrepareRenderCell event in GridTreeControl.


Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 14, 2009 09:37 AM UTC


Thanks for the details. Currently with the GridTreeControl, we have enabled themes that overrides the changes you have done. We are currently working out the Custom themes option where you can redefine the custom theme of the GridTreeControl. Please create a DTrac incident to follow up on that feature.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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