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

PanelBar Load on demand with grid

3 Answers 111 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 26 Oct 2009, 03:10 PM
Hi,

I have RadPanelbar (populating from database) and inside each panelbar item I am loading a radgrid (which is in usercontrol) with unique parameters for each panelbar item. The Grid contains few hundred records, and I am using radwindow to insert/edit items in the radgrid.

In this case, How can I improve the performance for the Panelbar with load on demand feature?


Thanks

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 26 Oct 2009, 04:20 PM
Hi TelNew,

Yes, this is what we would suggest to use for this case.

Regards,
Paul
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.
0
Sunny
Top achievements
Rank 1
answered on 26 Oct 2009, 04:36 PM
Paul,

Thanks for immediate response. But the sample loading user control, based on panelbar text. 

In my case, in aspx page load I am (see code below).

SomeControl.ascx contains a Self-Referencing Hierarchical RadGrid which populates data based on value from RadPanel (e.Item.Value)
Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
RadPanelBar2.ExpandMode = PanelBarExpandMode.FullExpandedItem 
RadPanelBar2.DataFieldID = "" 
RadPanelBar2.DataFieldParentID = "ID1" 
RadPanelBar2.DataTextField = "Name" 
RadPanelBar2.DataValueField = "Text" 
RadPanelBar2.DataSource = MyDS 
RadPanelBar2.DataBind() 
If Not Page.IsPostBack Then 
    RadPanelBar2.Items(0).Expanded = True 
End If 
End Sub 
 
 
Private Sub RadPanelBar2_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles RadPanelBar2.ItemDataBound 
Dim radPnlItem As New RadPanelItem 
Dim smControl As SomeControl 
smControl = CType(LoadControl("MyControls/SomeControl.ascx"), SomeControl) 
smControl.MyID = e.Item.Value 'Here I am passing value which is from Database 
radPnlItem.Controls.Add(smControl) 
e.Item.Items.Add(radPnlItem) 
End Sub 

0
Sunny
Top achievements
Rank 1
answered on 29 Oct 2009, 03:27 PM
I am implementing PanelBar Load on demand code (which in the link - firstpost). I am loading user control only when panelitem is selected.

Question: When the user goes back to the panelitem which he/she has already expanded few min. ago.. How to avoid executing (calling db or loadcontrol call) code again?
Tags
PanelBar
Asked by
Sunny
Top achievements
Rank 1
Answers by
Paul
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or