Here is the code snippet that I am currently working on, which involves a nested grid from Telerik:
I've encountered an issue with using JavaScript to locate and interact with controls named "PreviousDate" and "DateofBirth".
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Hierarchy.NestedViewTemplate.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>
<script type="text/javascript" language="javascript">
function showPreviousDate(sender, eventArgs) {
var Grid = $find("<%= RadGrid1.ClientID %>");
var MasterTable = Grid.get_masterTableView.get_dataItems();
for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
var row = MasterTable.get_dataItems()[i];
}
}
</script>
<body>
<form id="form1" runat="server">
<ajaxToolkit:TabContainer ID="tabPrevious" runat="server"
ActiveTabIndex="0"/>
<ajaxToolkit:TabPanel runat="server" HeaderText="Previous records"
ID="tabPrevious"/>
<ContentTemplate>
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1"
OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1"
runat="server" AutoGenerateColumns="False" AllowSorting="True"
AllowMultiRowSelection="False"
AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true"
OnItemCreated="RadGrid1_ItemCreated"
OnItemCommand="RadGrid1_ItemCommand">
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView DataSourceID="SqlDataSource1" GroupLoadMode="Server">
<NestedViewTemplate>
<asp:Panel ID="Panel1" runat="server" CssClass="viewWrap"
Visible="false">
<table runat="server" style="width: 100%;">
<tr>
<td align="center">Previous Records </td>
</tr>
<tr>
<td align="center">
<table>
<tr>
<td style="padding-right: 20px">
<asp:Label ID="labelDOb" runat="server" Text="Date of Birth" Width="100px"></asp:Label>
<telerik:RadDatePicker SharedCalendarID="SharedCalendar"
ShowPopupOnFocus="true" Enabled="false" RenderMode="Lightweight"
ID="DateofBirth" runat="server">
</telerik:RadDatePicker>
</td>
<td style="padding-right: 20px">
<asp:Label ID="labelDate" runat="server" Text="Previous Date" Width="100px">
</asp:Label>
<telerik:RadDatePicker SharedCalendarID="SharedCalendar" ShowPopupOnFocus="true"
Enabled="false" RenderMode="Lightweight" ID="PreviousDate" runat="server">
<ClientEvents OnDateSelected="showPreviousDate" />
</telerik:RadDatePicker>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</NestedViewTemplate>
</MasterTableView>
</telerik:RadGrid>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</html>
Any insights or assistance would be greatly appreciated.