I need a solution to work for a dynamically loaded user control that contains the grid and the context menu. When using...
<ClientEvents OnRowContextMenu="RowSelected" />
... and having the javascipt method embedded on the .ascx, the application throws error "RowSelected is undefined." I read on another post to use RegisterClientScriptBlock in the user control code behind which does get works for getting the RowSelected method recognized; however, the .show method of the context menu is undefined. When I code the following using RegisterClientScriptBlock, I get the undefined error for .show()
$find("<%= GridContextMenu.ClientID %>").show(args.get_domEvent());
<ClientEvents OnRowContextMenu="RowSelected" />
... and having the javascipt method embedded on the .ascx, the application throws error "RowSelected is undefined." I read on another post to use RegisterClientScriptBlock in the user control code behind which does get works for getting the RowSelected method recognized; however, the .show method of the context menu is undefined. When I code the following using RegisterClientScriptBlock, I get the undefined error for .show()
$find("<%= GridContextMenu.ClientID %>").show(args.get_domEvent());
...so I then tried...
document.getElementById('"
+ GridContextMenu.ClientID + "');
...which didn't work either.
So, the back to the original question: How do I get a context menu to work for a rad grid that is on a dynamically loaded user control?
I thought I'd make this a Post. I had asked the question in a reply to another Post, which may have not been appropriate.
http://www.telerik.com/community/forums/thread/b311D-bbktgd.aspx
Thanks for any help!
John D