I'm trying to fetch the ClientID for a RadGrid control from client side using JavaScript so that I'll be able to bind data to this from the client side.
The RadGrid is present within the RadLightBox and needs to be populated on a button click event. The markup for LightBox looks something like this.
<telerik:RadLightBox ID="RadLightBox1" runat="server">
<Items><telerik:RadLightBoxItemrunat="server"><ItemTemplate><telerik:RadGrid runat="server" ID="lightbox_radgrid"AutoGenerateColumns="false"><MasterTableView><Columns><%-- Columns not shown here --%> </Columns></MasterTableView><ClientSettings><ClientEvents OnCommand="window_radgrid_OnCommand"/></ClientSettings><GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" /></telerik:RadGrid></ItemTemplate></telerik:RadLightBoxItem></Items></telerik:RadLightBox>
This is the partial Javascript Code that I have written. I am able to find upto the RadLIghtBoxItem element but unable to fetch the RadGrid and it's clientID. This method is to be executed on success of a call to a web service to return the data.
function
onSucessCallThis(result, userContext, methodName)
{
var radWindow = $find('<%= lightbox.ClientID %>');var LightBoxItems = radWindow.get_items(); console.log(LightBoxItems); console.log(LightBoxItems.get_count());var item = LightBoxItems.getItem(0); console.log(item); //Able to fetch LightBoxItemvar radGrid = item.FindControl("lightbox_radgrid"); //Doesn't work
}
I'm not sure if this is the right way to have a radGrid inside a radLightBox. There isn't many examples of this online.
If the code is unreadable here please check this stackoverflow question
http://stackoverflow.com/questions/38481200/finding-the-client-id-for-a-radgrid-inside-a-radlightboxitem-tag-in-a-radlightbo