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

HeaderContextMenu mode

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bilal
Top achievements
Rank 1
Bilal asked on 25 Nov 2011, 02:54 PM
Hi Telerik Team,

Is there a way to fire the HeaderContextMenu of a RadGrid based on button click instead of Header right click?
I want to place a button in the header of the grid, once clicked it should open the HeaderContextMenu.

Please do let me know how can I achieve such scenario.

Thanks,
Bilal

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Nov 2011, 05:22 AM
Hello,

To show HeaderContextMenu on button click you can try the following JS.
JS:
<script type="text/javascript">
function OnClientClick()
 {
   var RadGrid = $find("<%=RadGrid1.ClientID %>");         
   RadGrid.get_headerMenu().show(window.event);
 }
</script>

Thanks,
Princy.
0
Antonio Stoilkov
Telerik team
answered on 28 Nov 2011, 05:44 AM
Hi Bilal,

You can certainly achieve your scenario but its not a trivial implementation. I have assembled a sample project demonstrating the desired functionality. Additionally, I recommend that you go through the showHeaderMenu section in the help article below:
All the best,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Bilal
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Antonio Stoilkov
Telerik team
Share this question
or