I am trying to bind to my labels in my nestedview template in my radgrid, but looking at telerik site but have not been able to find how they bind throught he code behind page and get a hold of the data key in the parenttablerelation. How can I bind to my controls via code behind page. I thought through the detialtabledatabind but nothing works for nested views.
Protected Sub myGridDeploy_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myGridDeploy.DetailTableDataBind
If e.DetailTableView.Name = "myUnitPos" Then
sql = "Select intPositionId, intUnitMobId, strPosnTitle, strPara, strLine, intPositionNum, strGrade, strMOS, strASI, strAuthBr, Case when intAsgnstr = 0 " _
& "then 'NO' else 'YES' end Filled From tblMobUnitPosition where intUnitMobID = " & e.DetailTableView.ParentItem.GetDataKeyValue("intUnitMobId") & " " _
& "order by strPara, strLine, intPositionNum"
e.DetailTableView.DataSource = getData(sql)
End If
sql = "Select intDeployId,intPositionId,si.FullName,si.strRank,si.AGE,si.strPmos,si.strSMOS,si.POSN_NBR_EXCESS_IND,si.SCTY_CLNC,si.ETS,si.strstatus,si.PHYS_PRFL_SER,si.intYearSvc, si.SRpDate,si.Deployable, " _
& "si.email From tblMobUnitPersonnel as up LEFT JOIN vw_Soldierinfo as si on si.strssn = up.strSSN where up.intPositionId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intPositionId") & ""
End Sub
<telerik:GridTableView DataKeyNames="intPositionId" Name="myUnitPos" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="intUnitMobId" MasterKeyField="intUnitMobId" />
</ParentTableRelation>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="InnerSubHeaderStyle" />
<ItemStyle CssClass="InnerSubItemStyle" HorizontalAlign="Center" />
<AlternatingItemStyle CssClass="InnerSubAlernatingItemStyle" HorizontalAlign="Center" />
<NestedViewSettings>
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="intPositionId" MasterKeyField="intPositionId" />
</ParentTableRelation>
</NestedViewSettings>
<NestedViewTemplate>
<asp:Panel ID="pnlInfo" runat="server" BorderStyle="Double" BorderColor="#85A3E0" Width="50%">
<table >
<tr>
<td><u>Soldier Information</u></td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
Name: <asp:Label ID="lblSoldier" runat="server" Text='<%#Bind("FUllName") %>'></asp:Label>
Rank: <asp:label ID="lblRank" runat="server" Text='<%#Bind("strRank") %>'></asp:label>
Age: <asp:Label ID="lblAge" runat="server" Text='<%#Bind("AGE") %>'></asp:Label>
</td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
PMOS: <asp:Label ID="lblPMOS" runat="server"></asp:Label>
SMOS: <asp:label ID="lblSMOS" runat="server"></asp:label>
POSN Excess: <asp:Label ID="lblPOSN" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
Clearance: <asp:Label ID="lblClear" runat="server"></asp:Label>
ETS\MRD: <asp:label ID="lblEts" runat="server"></asp:label>
Full-Time: <asp:Label ID="lblFullTime" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
PULHES: <asp:Label ID="lblPuhles" runat="server"></asp:Label>
Yrs Active: <asp:label ID="lblYrsActive" runat="server"></asp:label>
</td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
SRP Date: <asp:Label ID="lblDtSrp" runat="server"></asp:Label>
Deployable: <asp:label ID="lblDeplyable" runat="server"></asp:label>
</td>
</tr>
<tr>
<td style="height:5px"></td>
</tr>
<tr>
<td>
Email: <asp:Label ID="lblEmail" runat="server"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
</NestedViewTemplate>
<Columns>