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

headercontextmenu in hierarchical radgrid

1 Answer 23 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
esmyy asked on 30 Jul 2012, 09:38 AM
Hello everyone,
I have a problem with my Headercontextmenu, can somebody please help me?
This is my situation:
I have a hierarchical RadGrid with a detailtable. On my RadGrid I enabled a headercontextmenu with an additional control to add a new item in my RadGrid.
So I want a headercontextmenu on the detailtable; now when I click on my "add new record" - button in the headercontextmenu of the detailtable it adds a new item in my mastertable.
How can I check on which level the button was clicked?
Or can I add an additional headercontextmenu only for my detailtable?

Thanks in advance,
regards esmyy

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 01 Aug 2012, 04:29 PM
Hi Esmi,

You could declare different names for your table views and determine which one has to initiate the insert command using OnHeaderMenuShowing event:
    <ClientEvents OnHeaderMenuShowing="menuShowing" />
<MasterTableView ... Name="Master" EnableHeaderContextMenu="true">
      <telerik:GridTableView ... Name="Detail" EnableHeaderContextMenu="true">
function menuShowing(sender, args) {
    var tableViewName = args.get_gridColumn().get_owner().get_name();

That should do the trick.

Kind regards,
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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question