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

FindTabByText("RadTabStrip1") Object reference error

1 Answer 70 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
GARY078
Top achievements
Rank 1
GARY078 asked on 10 Sep 2012, 09:29 AM
I am getting an object reference error when using FindControl("RadTabStrip1").

I followed the Telerik Wizard demo to achieve this and I can see from other people's questions in the forum that this is a very common error to have. However none of the recommended solutions seemed to work for me.

I have attached 2 screenshots of the relevant code.

TabTestCS.png shows the code behind for the default page (not the Site.Master) showing the creation of tabs and pageviews.

Step2CS.png shows the code-behind for the "Next" button (from Step1.ascx.cs control page) which will be for the transition of Step1 to Step2 in the wizard.

TabTestASPX.png shows the TABTEST.aspx page where the RadTabStrip1 control is created.

I have tried assigning values to the tabs and locating them that way, but that didn't work either.

Any help you can provide would be much appreciated,

Thank you.
 

1 Answer, 1 is accepted

Sort by
0
GARY078
Top achievements
Rank 1
answered on 11 Sep 2012, 10:07 AM
Solved!

The method I used instead was:

protected void
Tab2_Next(object sender, EventArgs e)
{
    RadTabStrip tabStrip = (RadTabStrip)this.RadTabStrip1;

    RadTab Step2Tab = tabStrip.FindTabByValue("1");

    Step2Tab.Enabled = true;
    Step2Tab.Selected = true;

 

    RadMultiPage multiPage = (RadMultiPage)this.RadMultiPage1;

    RadPageView Step2PageView = multiPage.FindPageViewByID("Step2PageView");

    Step2PageView.Selected = true;
}

 

 

 

 

Tags
TabStrip
Asked by
GARY078
Top achievements
Rank 1
Answers by
GARY078
Top achievements
Rank 1
Share this question
or