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

How to add a Header cell from code behind?

1 Answer 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nivid
Top achievements
Rank 2
Nivid asked on 19 Sep 2013, 10:38 PM
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,

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 23 Sep 2013, 12:59 PM
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 >>
Tags
GridView
Asked by
Nivid
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Share this question
or