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

Having trouble getting MultiPage to go to specific view programatically

1 Answer 119 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
toddhd
Top achievements
Rank 1
toddhd asked on 22 Mar 2011, 03:41 PM
I have a TabStrip that is connected to a MultiPage. When using the UI, these two items are synched up correctly.

I use the tabs in a pseudo-wizard type application. When my app starts, all the tabs but the first one are disabled.  There is a button on the first tab (multipage actually) that when pressed, "starts" the process, and clicking it should enable all the other tabs, and move you to the second tab in the process to begin the data entry.

Here is my basic setup (partially removed items to condense code)
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Telerik" MultiPageID="RadMultiPage1">
    <Tabs>
        <telerik:RadTab runat="server" Text="Order Setup" Value="OrderSetup" PageViewID="rpvOrderSetup" Selected="true" />
        <telerik:RadTab runat="server" Text="Patient Information" Value="PatientInformation" PageViewID="rpvPatientInformation" Enabled="false" />
        <telerik:RadTab runat="server" Text="Order Information" Value="OrderInformation" PageViewID="rpvOrderInformation" Enabled="false" />
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
    <telerik:RadPageView ID="rpvOrderSetup" runat="server" Selected="true">
        <hr style="margin: 0px; padding: 0px; width: 100%;" />
        <local:OrderSetup runat="server" ID="OrderSetup" />
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpvPatientInformation" runat="server">
        <hr style="margin: 0px; padding: 0px; width: 100%;" />
        <local:PatientInformation runat="server" ID="PatientInformation" />
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpvOrderInformation" runat="server">
        <hr style="margin: 0px; padding: 0px; width: 100%;" />
        <local:OrderInformation runat="server" ID="OrderInformation" />
    </telerik:RadPageView>
</telerik:RadMultiPage>

And here is the code behind:
void OrderSetup_Click(EventArgs e)
{
    RadTabStrip1.FindTabByValue("OrderSetup").ImageUrl = "~/images/Ok.png";
    IList<RadTab> tabs = RadTabStrip1.GetAllTabs();
    foreach (RadTab tab in tabs) tab.Enabled = true;
    RadTabStrip1.FindTabByValue("PatientInformation").Selected = true;
    RadMultiPage1.FindPageViewByID("rpvPatientInformation").Selected = true;
    // RadMultiPage1.SelectedIndex = RadMultiPage1.FindPageViewByID("rpvPatientInformation").Index;
            // rpvPatientInformation.Selected = true;           
           // RadMultiPage1.SelectedIndex = 1; 
}

Most of this works. The image is added to the first tab, all the tabs are enabled, and the Patient Information tab is selected.

But what does NOT work is that the matching PageView is NOT selected. It still displays the PageView of the first tab.

What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Mar 2011, 11:22 AM
Hello,


Your code works perfectly in my end when I attached the "OrderSetup_Click" with a ButtonClick event.
Have you ajaxified the controls on page? If so you need to set the AjaxSettings properly to take the effect on page.
Add AjaxSettings programmatically


Thanks,
Princy.
Tags
TabStrip
Asked by
toddhd
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or