Devanand Jha
Top achievements
Rank 1
Devanand Jha
asked on 25 Aug 2009, 08:31 AM
Hi,
I want to enable DragToGroup option of Radgrid from Context menu. For this i have added new option in HeaderContextmenu's prerender event. My grid is in UserControl so cant use OnPreRenderComplete page event.
I have added HeaderContextMenu onitemClick handler to enable DragToGroup option of radGrid, but its not firing.
Please help me to get this event fire.
Regards
Devanand Jha
I want to enable DragToGroup option of Radgrid from Context menu. For this i have added new option in HeaderContextmenu's prerender event. My grid is in UserControl so cant use OnPreRenderComplete page event.
I have added HeaderContextMenu onitemClick handler to enable DragToGroup option of radGrid, but its not firing.
protected
void HeaderContextMenu_PreRender(object sender, EventArgs e)
{
RadContextMenu menu = wgEntityList.HeaderContextMenu;
RadMenuItem item = new RadMenuItem();
item.Text =
"Group by text";
menu.Items.Add(item);
}
protected
void HeaderContextMenu_ItemClick(object sender, RadMenuEventArgs e)
{
wgEntityList.ClientSettings.AllowDragToGroup =
true;
}
Please help me to get this event fire.
Regards
Devanand Jha
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 25 Aug 2009, 11:50 AM
Hi Devanand,
Give a try with the following approach and see whether it helps.
CS:
Regards
Princy.
Give a try with the following approach and see whether it helps.
CS:
protected void Page_Load(object sender, EventArgs e) |
{ |
RadGrid1.HeaderContextMenu.PreRender += new EventHandler(HeaderContextMenu_PreRender); RadGrid1.HeaderContextMenu.ItemClick += new RadMenuEventHandler(HeaderContextMenu_ItemClick); |
} |
void HeaderContextMenu_PreRender(object sender, EventArgs e) |
{ |
RadContextMenu menu = RadGrid1.HeaderContextMenu; |
RadMenuItem item = new RadMenuItem(); |
item.Text = "Group by text"; |
item.Attributes["ColumnName"] = string.Empty; |
item.Attributes["TableID"] = string.Empty; |
item.PostBack = true; |
menu.Items.Add(item); |
} |
void HeaderContextMenu_ItemClick(object sender, RadMenuEventArgs e) |
{ |
RadGrid1.ClientSettings.AllowDragToGroup = true; |
} |
Regards
Princy.
0
Devanand Jha
Top achievements
Rank 1
answered on 25 Aug 2009, 12:11 PM
Hi Princy,
Thanks for reply.
It's not working.
Regards
Devanand Jha
Thanks for reply.
It's not working.
Regards
Devanand Jha
0
Princy
Top achievements
Rank 2
answered on 26 Aug 2009, 05:25 AM
Hi Deva,
The above given code is working fine on my end. Could you please send the code portion where you are adding the event handler for the ItemClick and PreRender events of the HeaderContextMenu.
Princy
The above given code is working fine on my end. Could you please send the code portion where you are adding the event handler for the ItemClick and PreRender events of the HeaderContextMenu.
Princy
0
Devanand Jha
Top achievements
Rank 1
answered on 26 Aug 2009, 09:51 AM
Hi Princy,
I am adding these events handlers at PageLoad.
I am adding these events handlers at PageLoad.
protected
void Page_Load(object sender, EventArgs e)
{
RadGrid1.HeaderContextMenu.PreRender +=
new EventHandler(HeaderContextMenu_PreRender);
RadGrid1.HeaderContextMenu.ItemClick +=
new RadMenuEventHandler(HeaderContextMenu_ItemClick);
}
Regards,
Devanand Jha
0
Kyle Jang
Top achievements
Rank 1
answered on 29 Apr 2010, 08:22 PM
Hi Princy,
I have exactly same issue. When I debug in IE8, VS2010, it stops at middle of huge javascript and doesn't fire that event.
Error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Please help.
Thanks,
Kyle
I have exactly same issue. When I debug in IE8, VS2010, it stops at middle of huge javascript and doesn't fire that event.
Error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Please help.
Thanks,
Kyle
0
Erik
Top achievements
Rank 2
answered on 12 Apr 2011, 08:30 PM
may-be this post helps you?
http://www.telerik.com/community/forums/aspnet-ajax/grid/headercontextmenu-add-remove-items-vb-net.aspx#1284209
Regards,
Erik
http://www.telerik.com/community/forums/aspnet-ajax/grid/headercontextmenu-add-remove-items-vb-net.aspx#1284209
Regards,
Erik