This is a migrated thread and some comments may be shown as answers.

RadTreeView inside RadGrid

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hans
Top achievements
Rank 1
Hans asked on 03 May 2013, 05:26 PM
We have the following problem when paging a grid that is contained within a node of a radtreeview. Loading the first time this load grid smoothly (Figure 1). After trying to page the grid that does not trigger the event NeedDataSource (Figure 2) causing all grids disappears. Attached sample project. I can support.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 02 Aug 2013, 12:48 PM
Hi Hans,

I tried to replicate the issue,but its working fine at my side.Please try the below code snippet.

ASPX:
<telerik:RadTreeView runat="server" ID="RadTreeView1" Skin="Outlook">
    <Nodes>
        <telerik:RadTreeNode Text="RadTreeView" Expanded="true" >
            <Nodes>
                <telerik:RadTreeNode Text="RadGrid" >
                    <NodeTemplate>
                        <div class="node">
                            <span class="album">Grid 1</span>
                        </div>
                    </NodeTemplate>
                    <Nodes>
                        <telerik:RadTreeNode Text="RadGrid">
                            <NodeTemplate>
                                <div class="data">
                                    <telerik:RadGrid ID="RadGrid1" AllowPaging="True" PageSize="5" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
                                        GridLines="None">
                                        <MasterTableView>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                </div>
                            </NodeTemplate>
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode Text="RadGrid">
                    <NodeTemplate>
                        <div class="node">
                            <span class="album">Grid 2</span>
                        </div>
                    </NodeTemplate>
                    <Nodes>
                        <telerik:RadTreeNode Text="RadGrid">
                            <NodeTemplate>
                                <div class="data">
                                    <telerik:RadGrid ID="RadGrid2" AllowPaging="True" PageSize="5" runat="server" OnNeedDataSource="RadGrid2_NeedDataSource"
                                        GridLines="None">
                                        <MasterTableView>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                </div>
                            </NodeTemplate>
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>

C#:
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
   {
       (source as RadGrid).DataSource = GetDataTable("SELECT CustomerID, CompanyName FROM Customers");
   }
 
protected void RadGrid2_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
   {
       (source as RadGrid).DataSource = GetDataTable("SELECT OrderID, ShipCity FROM Orders");
   }

Thanks,
Princy
Tags
Grid
Asked by
Hans
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or