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

Radgrid inside NestedViewTemplate causing looping

2 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eduardo
Top achievements
Rank 1
Eduardo asked on 27 Apr 2016, 03:00 PM

Hi community,
I am facing the following challenge:

I have a Radgrid that contains a NestedViewTemplate and inside it has another Radgrid that bounds data on item command. Everything works fine until  i try to rebind. If i don´t expand any row everything works fine with the parent grid, i can change parameters on the data source and it rebinds without any problem. But if i expand the row the issue begins, because when i try to rebind the parent it takes way too long, sometimes an exception occurs. For example normally the parent loads 17 rows, which takes up to 14 seconds, but when i expand a row and try to rebind the parent to have results from other parameter, it takes 85 seconds or more, which is too much. Like if the child grids are somehow rebinding, which shouldn´t be happening because the data bounds on item command... . I´m using 2012 Q3 of telerik controls.

I don´t really know why this happens or if i´m doing something wrong. Any idea why is this happening?

Here is the code for the child grid to bind the data:

 protected void grdODLSummary_ItemCommand(object sender, GridCommandEventArgs e)
    {
        string command = e.CommandName;
        if (command == "ExpandCollapse")
        {
             GridDataItem eitem = e.Item as GridDataItem;
             GridNestedViewItem NestedItem = eitem.ChildItem;
             RadGrid grPR;
              if (NestedItem != null)
              {
                  grPR = NestedItem.FindControl("grdSummaryPR") as RadGrid;

                  if (grPR != null)
                  {
                      grPR.Rebind();
                  }
              }
        }
    }

2 Answers, 1 is accepted

Sort by
0
Eduardo
Top achievements
Rank 1
answered on 27 Apr 2016, 09:00 PM

Nevermind... I found the answer

http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx

0
Dimitar
Telerik team
answered on 02 May 2016, 07:16 AM
Hi,

Thank you for the followup.

I am glad to know that you have managed to resolve your issue. And thank you for pointing to the query solution, as it may help others having a similar issue.

Regards,
Dimitar
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
Eduardo
Top achievements
Rank 1
Answers by
Eduardo
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or