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

Adding RadTabStrip and MultipageView both programmaticly

1 Answer 37 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
A. Drost
Top achievements
Rank 1
A. Drost asked on 19 Sep 2011, 10:49 AM
Dear Al,

Currently I'm building a Form which dynamicly renders all the properties for a object. Therefore I create RadTabStrip and MultiPage both programmaticly I can in the rendered html that everything is created, however I am unable to switch the pages using the tabstrip.

What's going wrong overhere?

Thanks in advance


// First create the required means
 MultiPageStrip = new RadMultiPage() { ID = "Object_Form$MultiPageStrip", ClientIDMode = System.Web.UI.ClientIDMode.Static };
 TabStrip = new RadTabStrip() { MultiPageID = "Object_Form$MultiPageStrip" };

// Now is the beautifull part, we are going to generate the controls, we can that easily using the describtor
 foreach (Tab Tab in this.DataSource.MetaData.UserInterfaceDescriptor.Tabs)
 {
     RadPageView PageView = new RadPageView() { ID = "Object_Form$MultiPageStrip_Tab_" + TabStrip.Tabs.Count.ToString() };
     RadTab RadTab = new RadTab(Tab.Name) { PageViewID = "Object_Form$MultiPageStrip_Tab_" + TabStrip.Tabs.Count.ToString() };
     RenderTab(Tab, PageView);
     MultiPageStrip.PageViews.Add(PageView);
     TabStrip.Tabs.Add(RadTab);
 }
 
 // And add the create controls
 TabStrip.SelectedIndex = 0;
 MultiPageStrip.SelectedIndex = 0;
 ControlPanel.Controls.Add(TabStrip); ControlPanel.Controls.Add(MultiPageStrip);


1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 19 Sep 2011, 11:46 AM
Hello,

Please look in below code snippet

protected void Page_Load(object sender, EventArgs e)
    {
        RadTabStrip RadTabStrip1 = new RadTabStrip();
        RadTabStrip1.ID = "RadTabStrip1";
        RadMultiPage RadMultiPage1 = new RadMultiPage();
        RadMultiPage1.ID = "RadMultiPage1";
        RadTabStrip1.MultiPageID = RadMultiPage1.ID;
 
        string[] strTemp = new string[] { "t1","t2","t3" };
 
        foreach (string str in strTemp)
        {
            RadTab RadTab1 = new RadTab();
            RadTab1.Text = "test_ " + str;
            RadTabStrip1.Tabs.Add(RadTab1);
            RadPageView pageView1 = new RadPageView();
            pageView1.ID = str;
            RadTab1.Selected = true;
            pageView1.Selected = true;
            Label Label1 = new Label();
            Label1.Text = "Label_" + str;
            pageView1.Controls.Add(Label1);
            RadMultiPage1.PageViews.Add(pageView1);
 
        }
 
        RadTabStrip1.Tabs[0].Selected = true;
        RadMultiPage1.PageViews[0].Selected = true;
 
        Panel1.Controls.Add(RadTabStrip1);
        Panel1.Controls.Add(RadMultiPage1);
}


Thanks.
Jayesh Goyani
Tags
TabStrip
Asked by
A. Drost
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or