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

Radpanel itemclick - reloads entire page

1 Answer 79 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
PV
Top achievements
Rank 1
PV asked on 22 Oct 2010, 01:22 PM
Hello Team,

I have a Radpanelbar on a aspx and 5 items, and when clicked on item, a usercontrol is displayed in the div (that is made visible in the event OnItemClick).

The issue that is occuring is, when I click on one item, the entire is refreshed and all the usercontrol's pageload event is fired on the page.

I am looking at an approach where only the one user control to be loaded on click of one item instead of entire page refresh.

Radpanel looks like:

<telerik:RadPanelBar ID="pnlNav" runat="server" Width="180" OnItemClick="pnlNav_ItemClick"
                        EnableEmbeddedSkins="false" >
                        <Items>
                            <telerik:RadPanelItem Text="UserControl1" Value="UserControl1" Expanded="true"
                                PreventCollapse="true" ExpandedImageUrl="">
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="UserControl2" BackColor="#608DC8" Value="UserControl2" />
                            <telerik:RadPanelItem Text="UserControl3" Value="UserControl3" />
                            <telerik:RadPanelItem Text="UserControl4" Value="UserControl4" />
                                                   </Items>
                    </telerik:RadPanelBar>


 protected void pnlNav_ItemClick(object sender, RadPanelBarEventArgs e)
    {

 switch (e.Item.Value)
            {

                case "UserControl1":
                    this.UserControl1.Visible = true;
                    break;
                case "UserControl2":
                    this.divUserControl1.Visible = true;
                    this.ucUserControl1.Load();//public method
                    break;
                case "UserControl3":
                  ----//same code
                case "UserControl4":
                   same code
                    break;
}

Please provide any pointers if i am missing anything

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 27 Oct 2010, 11:34 AM
Hello PV,

My suggestion would be to use RadAjaxManager.
Here is a reference for it in our help documentation: http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html
Here is the first of many demo's in demos.telerik.com in the section for RadControls for ASP.NET AJAX: http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/firstlook/defaultcs.aspx

Hope this is going to help you!


Regards,
Nikolay Tsenkov
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
PanelBar
Asked by
PV
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or