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

[Solved] How to add ContextMenu to Header Cells with Column Virtualization On

1 Answer 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Wolfe
Top achievements
Rank 1
Michael Wolfe asked on 20 Dec 2009, 01:03 AM
I'm using your latest internal build (2009_3_1211) with a grid with column virtualization on. I'm trying to add a context menu to the grid header cells for the user to turn columns on and off like in your RadGrid / HeaderContextMenu example. However, with column virtualization on any column that isn't currently visible has no GridViewHeaderCell in the GridViewHeaderRow so I can't add the context menu to it. Once it becomes visible, the GridViewHeaderCell gets created but I can't find any event that fires so that my code can add the context menu when the column header cell becomes visible.
 
If I turn off the column virtualization, the GridViewHeaderCells are present for all comuns when the grid is loaded, but any column that was initially not visible will not show the context menu after it is made visible even though the context menu was created and attached while it was invisible.

Do you have an updated RadGrid / HeaderContextMenu example that works with the latest build?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 23 Dec 2009, 01:51 PM
Hello Michael Wolfe,

You can use a bit different approach with single menu for the entire grid and check which exactly element is clicked:
http://demos.telerik.com/silverlight/#GridView/RowContextMenu

We will update our header context menu demo for SP2 (middle of January) to use the same approach.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Michael Wolfe
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or