Adding RadTabStrip and MultipageView both programmaticly

2 posts, 0 answers
  1. A. Drost
    A. Drost avatar
    11 posts
    Member since:
    Jul 2009

    Posted 19 Sep 2011 Link to this post

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


  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 19 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top