Headercontextmenu issues

6 posts, 0 answers
  1. Aykut
    Aykut avatar
    25 posts
    Member since:
    Feb 2009

    Posted 20 May 2009 Link to this post

    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.


  2. Aykut
    Aykut avatar
    25 posts
    Member since:
    Feb 2009

    Posted 20 May 2009 Link to this post

    One more question ;
    Can I make headercontextmenu popup on mouseover of the columnheader instead of right click?
    Thanks.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aykut
    Aykut avatar
    25 posts
    Member since:
    Feb 2009

    Posted 21 May 2009 Link to this post

    No possible solution?
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 26 May 2009 Link to this post

    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.
  6. Aykut
    Aykut avatar
    25 posts
    Member since:
    Feb 2009

    Posted 26 May 2009 Link to this post

    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.
  7. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 23 Mar 2010 Link to this post

    Please send the code.  Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017