I have a RadGrid with a DetailTables nested inside it.
My design is simple: The RadGrid displays the contents of a table. When a row is expanded, I want to display the audit trail for that record which is saved in another table.
The relationship is 1 Table_Item to many Table_Item_History records.
Here's my solution thus far:
And my DataSources:
The resulting behavior is whenever a row is expanded, the child elements are always 0. I've tested the same query in multiple ways in SQL Server and they're working fine. I've tried this with Session Parameters and the results are the same.
Any assistance is appreciated
My design is simple: The RadGrid displays the contents of a table. When a row is expanded, I want to display the audit trail for that record which is saved in another table.
The relationship is 1 Table_Item to many Table_Item_History records.
Here's my solution thus far:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowPaging
=
"True"
PageSize
=
"5"
DataSourceID
=
"SqlDataSource1"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"false"
AllowSorting
=
"true"
AllowMultiRowSelection
=
"false"
GridLines
=
"None"
>
<
MasterTableView
DataKeyNames
=
"Asset_Id"
EnableHierarchyExpandAll
=
"true"
AllowMultiColumnSorting
=
"true"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
DataSourceID
=
"SqlDataSource2"
EnableHierarchyExpandAll
=
"true"
Width
=
"100%"
DataKeyNames
=
"Asset_Id"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"Asset_Id"
MasterKeyField
=
"Asset_Id"
/>
</
ParentTableRelation
>
<
Columns
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
And my DataSources:
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Asset]"
runat="server"></
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Asset_History] WHERE ([Asset_Id] = @Asset_Id)"
runat="server">
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"RadGrid1"
Name
=
"Asset_Id"
PropertyName
=
"SelectedValue"
Type
=
"Object"
></
asp:ControlParameter
>
</
SelectParameters
>
</
asp:SqlDataSource
>
The resulting behavior is whenever a row is expanded, the child elements are always 0. I've tested the same query in multiple ways in SQL Server and they're working fine. I've tried this with Session Parameters and the results are the same.
Any assistance is appreciated