This is a migrated thread and some comments may be shown as answers.

Get clientside RadGrid inside RadGrid Edit Form

2 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 10 Nov 2016, 03:59 PM

Hi,

I have a RadGrid inside the EditForm of the main RadGrid:

<telerik:RadGrid runat="server" ID="RadGrid1">
  <EditFormSettings EditFormType="Template">
    <FormTemplate>
      <div>
        <asp:Panel runat="server" ID="Panel1">
          <table><tr><td>
            <telerik:RadGrid runat="server" ID="InnerRadGrid"></telerik:RadGrid>
          </td></tr></table>
        </asp:Panel>
      </div>
    </FormTemplate>
  </EditFormSettings>
</telerik:RadGrid>

 

How can I reach via javascript the InnerRadGrid

I tried using 

RadGrid1.Controls.Add(new LiteralControl("<script type='text/javascript'>window['InnerRadGrid'] = '" + InnerRadGrid.ClientID + "';</script>"));
 var grid = document.getElementById(window['InnerRadGrid']);

 

in RadGrid1_ItemCreated() but id doesn't work.

 

I need it because in the header of some TemplateColumn in the InnerRadGrid I have a checkbox which, when toggled, shoul select/deselect every checkbox in that column. If there is another way to reach this functionality, it'd be fine.

 

Thank you, regards

Nick

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 15 Nov 2016, 09:35 AM
Hello Nick,

You can use the $telerik.findControl(container, id) method to get reference to the RadGrid in the edit form when it is initialized:
$telerik.findControl($find("<%=RadGrid1.ClientID%>").get_element(), "InnerRadGrid")

Please give this a try and see if it will work in your project.


Best Regards,
Konstantin Dikov
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Nick
Top achievements
Rank 1
answered on 15 Nov 2016, 11:28 AM

That worked perfectly, thank you!

Best regards,
Nick

Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Nick
Top achievements
Rank 1
Share this question
or