I really like the show/hide columns functionality built into the context menu (EnableHeaderContextMenu). However, I can't count on users to right-click to open the menu.
To cover myself, I'd like to put a button in the command area that will open the header context menu so they can see it.
As an alternative, I'd be interested in seeing sample code to implement the show/hide column checkboxes in a regular menu or dropdown.
Thanks!
Ken
4 Answers, 1 is accepted
Hi Ken,
You can show the menu, as demonstrated in the code snippet below:
<asp:Label runat="server" ID="Label1" Text="ShowContextMenu" onclick="ShowMenu();"></asp:Label>
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock">
<script type="text/javascript">
function ShowMenu()
{
var RadGrid = $find("<%=RadGrid1.ClientID %>");
RadGrid.get_headerMenu().show(window.event);
}
</script>
</telerik:RadScriptBlock>
I hope this helps.
Regards,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

When i clicked directly on "ShowContextMenu" without clicking any where in header.It shows the context menu with all columns in unchecked state in columns menu and when i checked/unchecked the infant of columns name then radgrid is not refreshed .I want it show checked/unchecked columns in the basis on columns shows in rad grid.
Thanks
Sandeep Trivedi
In this case, you can use a standard RadMenu, which will be shown when clicking on the label. This will allow you to customize it either statically, or dynamically, when showing it.
I hope this is a feasible approach for you.
Regards,
Yavor
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.

for example:
I want open headercontextmenu using OnTouchMove.
Thanks!