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

lazy loading grid in panelitem

3 Answers 97 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 2
Mario asked on 27 Nov 2009, 04:31 PM
hi,

i have an approach to make my profile.aspx page faster. That page includes a panelbar with 6 different panelitems, each containing at least one grid gathering information from the database. I thought to make the page faster. i dont query the database for the grids and hold all panelitems collapsed except of the top/first panelitem.

so if the user wants to see the information of a panelitem, following mechanic comes into play:

the grid in the panelitem is still created in and configured as stated in my aspx code file. It just gets no DataSource:

protected void RadGridRelations_NeedDatasource(object source, GridNeedDataSourceEventArgs e) 
            RadPanelItem panelItem = panelBarProfile.FindItemByValue("relations"); 
 
            if (panelItem.Expanded) 
            { 
                RadGrid radGrid = source as RadGrid; 
                radGrid.DataSource = BLDocument.GetAllRelatedDocumentsMultipleTimes(CacheHelper.Instance.Document.id, _userId); 
                radGrid.MasterTableView.NoMasterRecordsText = LanguageHelper.GetText("noRelationsText"); 
            } 

the grid is only allowed to load the data from the database if the panelitem got expanded.

hint: dont forget to ajaxify the panelbar and the grid.

another feature is that if the panelitem gets collapsed and expanded it gets the data from server again so its uptodate.

how u find it? please tell me if thats a good approach.

thx, mario

3 Answers, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 01 Dec 2009, 04:27 PM
Hi Mario,

the approach seems quite good to me. Thank you for posting it.
0
Mario
Top achievements
Rank 2
answered on 02 Dec 2009, 09:59 AM
hm,

but theres a problem and i dont yet know if i its tolerable.. when u click the panelitem to expand the browser jumps to the top of the page. When its finished processing/loading it jumps back to the place the panelitem is placed.

dont think thats a neat behavoir ..
0
Veselin Vasilev
Telerik team
answered on 04 Dec 2009, 10:30 AM
Hello Mario,

I think the best way to proceed is to send us a sample running page (in a support ticket) and we will give you a solution.

Greetings,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
PanelBar
Asked by
Mario
Top achievements
Rank 2
Answers by
Vesko
Top achievements
Rank 2
Mario
Top achievements
Rank 2
Veselin Vasilev
Telerik team
Share this question
or