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)
{
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