How to add a Header cell from code behind?

2 posts, 0 answers
  1. Nivid
    Nivid  avatar
    14 posts
    Member since:
    Jun 2012

    Posted 19 Sep 2013 Link to this post

    I wanted to add a column chooser functionality in the gridview. I have done it in past but had a question that can it be acheived by just adding a header cell from codebehind or by any other way. I have done it by using the row indicator column and using the space on the header to open choose column window, which i have attached a image of that. 

    Question here is that is there a way to hide the row indicator column and just use the extra header on top/ or code behind way to add a header cell which handles this functionality. 


    Thanks,

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Sep 2013 Link to this post

    Hello,

    You can check "Header Context Menu"  WPF Demo for an example on how to attach a ContextMenu to the header cells. When OnMenuOpened event is raised, you can decide whether to show the menu or hide it.

    Let me know how this works for you.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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