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

Headercontextmenu issues

5 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aykut
Top achievements
Rank 1
Aykut asked on 20 May 2009, 09:08 PM
Hi,
I have a couple of problems with Headercontextmenu.

First I have a SortCommand event for the grid to handle the sorting manually.
This event doesnt get fired with any of the Sort Asc or Sort Desc menu items.
My grid is in a ajax panel and it just dissappears when I click any of those menu items.

 --------

Second I added a custom menu item to the Headercontextmenu with the help of a sample that I found here.

    protected override void OnPreRenderComplete(EventArgs e)
    {
        string BaseUrl = Request.Url.ToString().Substring(0, Request.Url.ToString().IndexOf("?"));
        RadContextMenu menu = RadGrid1.HeaderContextMenu;
        RadMenuItem item = new RadMenuItem();
        item.Text = "Expand To SubColumns";
        menu.Items.Add(item);
        base.OnPreRenderComplete(e);
    }

But I cannot do anything with the help of this menu item because of 2 problems.

1. I cannot change the ID of this custom menu item and it is my only chance that I can understand postback is caused by this menu item. Currently when I look at    Request["__EVENTTARGET"],  I see ctl00$ContentPlaceHolder1$RadGrid1$rghcMenu as the postback creator.

2. I dont know which column user right clicked and selected the custom menu item. Is there a way to get the column name for the clicked item in the  Headercontextmenu.

Thanks for your help.


5 Answers, 1 is accepted

Sort by
0
Aykut
Top achievements
Rank 1
answered on 20 May 2009, 09:51 PM
One more question ;
Can I make headercontextmenu popup on mouseover of the columnheader instead of right click?
Thanks.

0
Aykut
Top achievements
Rank 1
answered on 21 May 2009, 12:16 PM
No possible solution?
0
Yavor
Telerik team
answered on 26 May 2009, 06:37 AM
Hello Aykut,

Can you please supply the grid declaration, and the code behind? I suspect that the control is not properly bound, and this is what is causing it to disappear on command.

Best wishes,
Yavor
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.
0
Aykut
Top achievements
Rank 1
answered on 26 May 2009, 12:58 PM
Sorry for late reply since we had a holiday.
I disabled contextmenu of the grid. I put another contextmenu on the page and I am popping up this menu with javascript.
So everything is ok now. If someone needs the code I can send it.
Thanks for your concern.
0
DW Web Team Member
Top achievements
Rank 2
answered on 23 Mar 2010, 05:07 AM
Please send the code.  Thanks.
Tags
Grid
Asked by
Aykut
Top achievements
Rank 1
Answers by
Aykut
Top achievements
Rank 1
Yavor
Telerik team
DW Web Team Member
Top achievements
Rank 2
Share this question
or