I am trying to get the selected row values of the DetailTable View.
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"></telerik:GridClientSelectColumn>
GridClient Select Column is in DetailTable.
I need to get the values of each column of selected Row in DetailTable View when i pressed the Button "Procced with Selected Rows"
Regards,
6 Answers, 1 is accepted

You can traverse through the items in the grid and check for the item.OwnerTableView.Name whether it is DetailTable Name and get the corresponding values.
The following help documentation shows how to achieve this.
Traversing detail tables/items in Telerik RadGrid
-Shinu.

Dear,
i need to access the columns values. please can you check my code.
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
For Each item As GridDataItem In RadGrid1.Items
If item.OwnerTableView.Name = "Rooms" Then
If item.Selected = True Then
txtValues.Text &= item.OwnerTableView.DataKeyValues(item.ItemIndex)("HotelCode").ToString
Dim DT As GridDataItem = item.OwnerTableView.Items(item.ItemIndex)
txtValues.Text = DT("RoomtypeCode").Text
End If
End If
Next
End Sub
There are four others Column i have to acces their values.
Dim DT As GridDataItem = item.OwnerTableView.Items(item.ItemIndex)
txtValues.Text = DT("RoomtypeCode").Text
above code is noting returning......

protected void Button1_Click(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.Items) |
{ |
if (item.OwnerTableView.Name == "Detail") |
{ |
if(item.Selected) |
{ |
string str = item["ColumnUniqueName"].Text; |
} |
} |
} |
} |

first of all I try this code but nothign is working, it return "" (emptry string value).
This is Child Table Coding
<columns>
<telerik:GridBoundColumn UniqueName="RTypeCode" DataField="RoomTypeCode" Visible="false"></telerik:GridBoundColumn>
</columns>
<itemTemplate>
<%#DataBinder.Eval(Container.DataItem, "RoomType")%>
</itemTemplate>
For Each item As GridDataItem In RadGrid1.Items
If item.OwnerTableView.Name = "Rooms" Then
If item.Selected Then
Dim str As String = item("RTypeCode").Text
RadAjaxManager1.Alert(str)
End If
End If
Next
*
|---Master
|----------- Child (selected value)
on same level i need to get the parent values as well of the selected row.
************ Extra Information *****************
Right now i m getting values throuh "ClientDataKeyNames"
<telerik:GridTableView Name="Rooms" ClientDataKeyNames="HotelCode,RoomTypeCode,RoomType,RoomBasis,cancellation,Total" DataKeyNames="HotelCode" runat="server" BorderStyle="None">
<Columns>
<telerik:GridBoundColumn DataField="HotelCode" Visible="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="RTypeCode" DataField="RoomTypeCode" Visible="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="cancellation" Visible="false"></telerik:GridBoundColumn>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" Visible="true"></telerik:GridClientSelectColumn>
</Columns>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" width="100%" style="border-style:solid; border-width:1px; border-color:#E4B93C">
<tr>
<td width="150" style="height:20px"><span class="Font8Gray"><%#DataBinder.Eval(Container.DataItem, "RoomType")%></span></td>
<td width="5" style="height:20px"></td>
<td width="100" style="height:20px"><span class="Font8Gray"><%#DataBinder.Eval(Container.DataItem, "RoomBasis")%></span></td>
<td width="5"></td>
<td width="100" style="height:20px"><span class="Font8Gray"><%#DataBinder.Eval(Container.DataItem, "Total")%></span></td>
<td width="50" style="height:20px">
<asp:HyperLink ID="hypBook" runat="server" Text="Book" NavigateUrl="Booknow.aspx?CodeID" CssClass="link1"></asp:HyperLink>
</td>
</tr>
<tr>
<td colspan="6"><asp:Label ID="lblSpecialDeals" CssClass="Font8White" runat="server" Visible="true" Text='<%#DataBinder.Eval(Container.DataItem,"SpecialDeal") %>'></asp:Label></td>
</tr>
</table>
</ItemTemplate>
</telerik:GridTableView>
********************************* End here *************************


Thank you its Work..............