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

Nested Grid Loading Issue

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Param Eswaran
Top achievements
Rank 1
Param Eswaran asked on 09 Apr 2010, 08:06 AM

Dear Telerik,

                 Is there any way to bind the child (or) nested grid based on the corresponding tab selected?

Say example, if I select the first tab of the nested grid the respective grid need to be bind only that time rest of grids not need to bind. Suppose if I go to the second tab then the only that time the second grid need to bind mean while the first tab grid data need to be set nothing or clear.

 

Whether the above mentioned way would help to achieve the speed or performance of the grid. If so point out how we can achieve the scenario.

I used the below mentioned to bind the nested grid's already, but it leads to slow in loading the nested grid for each operations

protected void ParentGrid_PreRender(object sender, EventArgs e)     
{     
    foreach (GridDataItem item in ParentGrid.MasterTableView.Items)     
          {                   
                if (item.Expanded)     
                {     
                  //foreach (GridNestedViewItem item1 in RadFirmGrid.MasterTableView.GetItems(GridItemType.NestedView))     
                  //{     
                    GridNestedViewItem item1 = RadFirmGrid.MasterTableView.GetItems(GridItemType.NestedView)[item.ItemIndex] as GridNestedViewItem;     
                         
                    // Binding Cutomer grid         
                    RadGrid Child1 = (RadGrid)item1.FindControl("Customer");     
             
                    // Binding Products grid         
                    RadGrid Child2 = (RadGrid)item1.FindControl("Products");    

Looking forward for your guidance

-Thanks

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 14 Apr 2010, 11:51 AM
Hi Param,

Basically, with such a setup, only the relevant tabs/levels of the control are populated. For example, when expanding another level of the control, the grid would not repopulate, only the data for the new level(s) will be fetched. This behavior is demonstrated in the following example:

http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

Other than this, changing the datasource explicitly for any level, is not a feasible approach - the data needs to be passed either through DetailTableDataBind, or through a datasource control.
I hope this information helps.

Sincerely yours,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Param Eswaran
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or