I have a "Main" grid on the page which generates many reports based upon the user selection.
Here is the code of the Grid:
Some of the reports requires Hierarchy Grids within the MasterTableView which we create once the user clicks the "Generate Report Button". Here is the code to add the DetailsTables on Button Click:
We use the NeedDataSource event to re-populate the main grid when needed:
Expending the grids works well and the data is shown via DetailsTableDataBind:
Problem starts when you try to Sort or Page in the inner Grids. It simply doesn't work. No event gets fired, not "NeedDataSource" or "DetailsTableDataBind".
Your help is appreciated.
Here is the code of the Grid:
<telerik:RadGrid ID="gvMainControl" runat="server" AutoGenerateColumns="true" GridLines="None" CellPadding="0" CellSpacing="0" AllowPaging="False" Skin="WebBlue" AllowSorting="true" ShowFooter="True" EnableLinqExpressions="false" AllowCustomPaging="false" > <MasterTableView TableLayout="Auto" AllowFilteringByColumn="False" PageSize="20" CommandItemDisplay="Top" AllowCustomPaging="false" > </MasterTableView></telerik:RadGrid>Some of the reports requires Hierarchy Grids within the MasterTableView which we create once the user clicks the "Generate Report Button". Here is the code to add the DetailsTables on Button Click:
For i = 0 To intLevels Dim tableViewOrders As New Telerik.Web.UI.GridTableView() tableViewOrders.DataMember = dicTemp(i).GroupBy.GroupBy(0) gvMainControl.MasterTableView.DetailTables.Add(tableViewOrders) Next iWe use the NeedDataSource event to re-populate the main grid when needed:
Protected Sub gvMainControl_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gvMainControl.NeedDataSource gvMainControl.DataSource = reporting_service.Run(Of Reporting.Item_DrillDown)() gvMainControl.MasterTableView.DataKeyNames = {"Category_Name"} gvMainControl.MasterTableView.ClientDataKeyNames = {"Category_Name"}End SubExpending the grids works well and the data is shown via DetailsTableDataBind:
Protected Sub gvMainControl_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles gvMainControl.DetailTableDataBind If e.DetailTableView.DataMember = "Item_Name" Then Dim strCategory_Name As String = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem).GetDataKeyValue("Category_Name") e.DetailTableView.DataSource = New Reporting_Service.Query(Global.Reporting_Service.Query.Report_Type.Items, New Dictionary(Of String, String) From {{"Category_Name", strCategory_Name}}, _ Nothing, New Reporting_Service.Query.Group(New List(Of String)({"Item_Name"}), New List(Of String)({"Quantity", "Total_Price"})), New List(Of String)({"Quantity"}), True, Nothing, Me.strUniqueID).Run(Of Reporting.Item_DrillDown)() End IfProblem starts when you try to Sort or Page in the inner Grids. It simply doesn't work. No event gets fired, not "NeedDataSource" or "DetailsTableDataBind".
Your help is appreciated.