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.
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.