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

headercontextmenu in hierarchical radgrid

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
esmyy
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
0
Accepted
Eyup
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:
  mark-up:
<ClientSettings>
    <ClientEvents OnHeaderMenuShowing="menuShowing" />
</ClientSettings>
<MasterTableView ... Name="Master" EnableHeaderContextMenu="true">
    <DetailTables>
      <telerik:GridTableView ... Name="Detail" EnableHeaderContextMenu="true">
  JavaScript:
function menuShowing(sender, args) {
    var tableViewName = args.get_gridColumn().get_owner().get_name();
    alert(tableViewName);
}

That should do the trick.

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