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

performance problem with the nestedViewTemplate

2 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
mathieu asked on 24 Jul 2012, 06:25 PM
hello everyone

i'm trying to do something very similar to Grid / Hierarchy with Templates but i can't use the datasource the same way.

We use Entity Framework with custom object and so we need to databind the data with the event OnNeedDataSource.
Everything is working fine except that the HierarchyLoadMode="ServerBind" doesn't work because i can't set (or don't know how to) set the nestedViewSettings so the grid load all the usercontrol that is on the nestedView.

I want to load the user control only when it is showed and not in any other case.
I tried to let the usercontrol be load but without bind the data on it. At this point it's fast enough but I can't figure out which row is expand in the page_load to know if i have to load the data or not.


2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 27 Jul 2012, 05:40 PM
Hello Mathieu,

You can handle the ItemCreated event of the grid check if the item is .Expanded and set Visible=false to your user control if the item is not expanded. When the user control is not visible, it should not be bound.
You can also check this help topic about accessing items inside the grid, if you are not sure how to get the controls inside the item:
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

Regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 08 Aug 2012, 10:45 PM
thanks

in the meanwhile i figure out how to do.
i just try to load the less thing that i can, that's mean my page load is empty and there is no event to load my data in the nestedview.
and in the itemcommand event i check if the event is expandedcollapse if so i call a function that load every thing in the correct control :-)

i tried before in the pageload if i could test for if(.isexpanded) but in fact the page load of the nestedview control is called before the status of the row change so that's couldn't work :-(

Tags
Grid
Asked by
mathieu
Top achievements
Rank 1
Answers by
Vasil
Telerik team
mathieu
Top achievements
Rank 1
Share this question
or