Ok, I hope the topic title is self explanatory, anyway... I have RadToolbar inside a CommandItemTemplate of a RadGrid.
I have a client event tied to the RadToolbar on click (wich checks if grid items are selected otherwise triggers a js alert).
Since I want to use the same function for the multiple grids I have on the page I cannot use $find("<%=GridName.ClientID%>") inside the onclick function. A workaround would be to bind different functions, where I just define the $find("<%=GridName.ClientID%>") for each grid and then call the main function. But a neater solution would be to retrieve GridName.ClientID inside the function just from JS without resorting to inline asp.net code.
I tryed mangling with the "sender" object (wich is the toolbar triggering the click event) in the function to try to get the parent grid clientID but with no luck.
Any hint?
The structure is this:
Any hint?...
I have a client event tied to the RadToolbar on click (wich checks if grid items are selected otherwise triggers a js alert).
Since I want to use the same function for the multiple grids I have on the page I cannot use $find("<%=GridName.ClientID%>") inside the onclick function. A workaround would be to bind different functions, where I just define the $find("<%=GridName.ClientID%>") for each grid and then call the main function. But a neater solution would be to retrieve GridName.ClientID inside the function just from JS without resorting to inline asp.net code.
I tryed mangling with the "sender" object (wich is the toolbar triggering the click event) in the function to try to get the parent grid clientID but with no luck.
Any hint?
The structure is this:
<
telerik:RadGrid
runat
=
"server"
ID
=
"GridName"
<MasterTableView
<CommandItemTemplate>
<telerik:RadToolBar OnClientButtonClicking="TheFunction"
....
function TheFunction(sender, args) {
var myGrid = $find("<%=GridName.ClientID%>"); // TO BE RESOLVED WITHOUT EXPLICIT REFERENCE WITH <% %>
Any hint?...