This is a migrated thread and some comments may be shown as answers.

Disable header click and hottracking

1 Answer 412 Views
GridView
This is a migrated thread and some comments may be shown as answers.
DDS
Top achievements
Rank 1
DDS asked on 26 Jul 2013, 11:07 AM
Hello,

I have a DataGridView with TelerikMetro theme. I've set EnableHotTracking to False, but header cells still follow mouse hover events, e.g. border around header cell is highlighted when mouse is over header cell.
I need to disable that HotTracking for header and also make header non-clickable.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 31 Jul 2013, 10:24 AM
Hello Dmitry,

Thank you for writing.

To disable sorting when you click on header cell, you should set the EnableSorting property to false. For example:
this.radGridView1.EnableSorting = false;

The cleanest way to achieve the desired styling of header cell is by small modification of the theme. To accomplish that, you should remove the styling of GridHeaderCellElement.MouseOver and GridHeaderCellElement.MouseDown states. Attached you can find an image which points where you can find these states.

In this documentation article you can read how to use custom themes: http://www.telerik.com/help/winforms/themes-using-custom-themes.html

I hope this helps.

Regards,
Anton
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
DDS
Top achievements
Rank 1
Answers by
Anton
Telerik team
Share this question
or