Disable header click and hottracking

2 posts, 0 answers
  1. DDS
    DDS avatar
    5 posts
    Member since:
    Jul 2013

    Posted 26 Jul 2013 Link to this post

    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.
  2. Anton
    Admin
    Anton avatar
    167 posts

    Posted 31 Jul 2013 Link to this post

    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 >>
Back to Top