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. Image for the cookie policy date
close icon

Prevent header text color form changing when moving mouse over

Hello, I'm having a problem with header text color.

Here is what I have.

private void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex == 0)
{
e.Style.TextColor = Color.White;
}
else if (e.ColIndex == 0)
{
e.Style.TextColor = Color.White;
}
}


The text is changing to white however when moving the mouse over the headers the text turns to black. What is causing this and how can I prevent it?
Thanks



1 Reply

AS Asarudheen S Syncfusion Team September 10, 2011 06:00 AM UTC

Hi Johnny,

Thank you for your interest in Syncfusion products.

You can prevent header text color from changing when moving mouse over by setting “e.Style.Clickable = false” in the event .Please refer the following code to achieve the behaviour.


void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex == 0)
{
e.Style.TextColor = Color.White;
e.Style.Clickable = false;


}
else if (e.ColIndex == 0)
{
e.Style.TextColor = Color.White;
e.Style.Clickable = false;

}
}


Here is the sample for your reference.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=1007641319004667.zip

Please let us know if you need any further assistance.

Regards,
Asarudheen.




Loader.
Live Chat Icon For mobile
Up arrow icon