hello,
i have a web page on which 3 user controls A,B,C are registered.
RadTab controlis used and User controls A and B is added on RadPageView 1 and 2 respectively.
User Control C also exists on the same web page but not on the RadTab.
By default, RadPageView 1 i.e. User Control A is selected.
On User Control B there exists a repeater to which some rows are binded.
On User Control C, there is a link button. When it is clicked, RadPageView 2 i.e. User Control B should be selected
and the repeater rows shud be filtered accordingly. Now, the problem is that when the link button is clicked
the repeater is having the correct number of rows but the RadPageView 2 is showing the correct number of rows
till i click the link button twice.
Please help.
Code Snippet:
Code Snippet:
WebPage.aspx
=============
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="UserControlA" TagName="UserControlA" %>
<%@ Register TagPrefix="UserControlB" TagName="UserControlB" %>
<%@ Register TagPrefix="UserControlC" TagName="UserControlC" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
runat
=
"server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
div
class
=
"content"
>
<
div
class
=
"menu-1"
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"tabStrip"
Skin
=
""
MultiPageID
=
"RadMultiPage1"
>
<
Tabs
> <
telerik:RadTab
Selected
=
"true"
SelectedCssClass
=
"active-1"
Text
=
"Tab 1"
TabIndex
=
"0"
></
telerik:RadTab
>
<
telerik:RadTab
SelectedCssClass
=
"active-1"
Text
=
"Tab 2"
TabIndex
=
"1"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
</
div
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage1"
runat
=
"server"
SelectedIndex
=
"0"
CssClass
=
"multiPage"
>
<
telerik:RadPageView
ID
=
"rpvUserControlA"
runat
=
"server"
><
UserControlA:UserControlA
runat
=
"server"
id
=
"UserControlA"
/></
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"rpvUserControlB"
runat
=
"server"
><
UserControlB:UserControlB
runat
=
"server"
id
=
"UserControlB"
/></
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
div
>
<
div
class
=
"right-sidebar"
>
<
UserControlC:UserControlC
runat
=
"server"
id
=
"UserControlC"
/>
</
div
>
</
asp:Content
>
UserControlB.ascx
=================
<
asp:Repeater
ID
=
"Repeater1"
runat
=
"server"
>
</
asp:Repeater
>
UserControlB.ascx.cs
====================
public void LoadPage(UserControlB uc)
{
Page_Load(uc, null);
}
protected void Page_Load(object sender, EventArgs e)
{
if (Session["ID"] != null)
{
int id = (int)Session["ID"];
DataTable dt = Fetch records from database based on id
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
}
UserControlC.ascx
==================
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
onclick
=
"LinkButton1_Click"
>Show Details</
asp:LinkButton
>
UserControlC.ascx.cs
====================
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session["ID"] = "23829839";
UserControlB uc = (UserControlB)this.Page.LoadControl("~/UserControlB.ascx");
uc.LoadPage(uc);
RadTabStrip radTabs = (RadTabStrip)cpHolder.FindControl("tabStrip");
RadMultiPage radMultiPage = (RadMultiPage)cpHolder.FindControl("RadMultiPage1");
radTabs.Tabs[0].Selected = false;
radTabs.SelectedIndex = 1;
radTabs.Tabs[1].PageView.Selected = true;
radTabs.MultiPage.SelectedIndex = 1;
radTabs.Tabs[1].Enabled = true;
radMultiPage.SelectedIndex = radTabs.SelectedIndex;
}