How to add a label inside a childtab dynamically

3 posts, 0 answers
  1. Marc Plaxton-Harrison
    Marc Plaxton-Harrison avatar
    40 posts
    Member since:
    Mar 2008

    Posted 13 Oct 2016 Link to this post

    Good day,

    lately i have been battling with adding a label control inside a child tab so that i could display the challengers on after clicking on that tab

    here is my code below...

    private void LoadTournament(EventCollection eventCollection, RadTabStrip radTabStrip)
               RadMultiPage Multiview = new RadMultiPage();
               Multiview.ID = "Multiview1";
              RadPageView PageView = new RadPageView();
               //Pageview.ID = "";
               //Pageview.ID ="";
               foreach (RadTab tb in radTabStrip.Tabs)
                   int iSportId = int.Parse(tb.Value);
                   tb.ScrollChildren = true;
                   foreach (var ev in eventCollection.Events)
                       if (ev.SportID == iSportId)
                           // Create new to a RadTab.
                           RadTab tab = new RadTab();
                           tab.Value = ev.TournamentID.ToString();
                           tab.Text = ev.Tournament;
                           foreach (var item in ev.Challengers)
                               Label label = new Label();
                               label.Text = item.Name;
                               tb.PageViewID = "Page1";
                               tb.SelectedIndex = tab.Index;
                               radTabStrip.MultiPageID = "Multiview1";
                               //        RadPageView PageView = loadchallenger(eventCollection);
                               PageView.ID = "Page1";
                               PageView.Height = 500;
                           //foreach (var item in ev.Challengers )
                           //    TextBoxTemplate template = new TextBoxTemplate();
                           //    Label label = new Label();
                           //    label.Text = item.Name;
                           //    Pageview.Controls.Add(label);


    I would like to add labels inside a child tab please help anyone,

    please below capture


  2. Marc Plaxton-Harrison
    Marc Plaxton-Harrison avatar
    40 posts
    Member since:
    Mar 2008

    Posted 17 Oct 2016 in reply to Marc Plaxton-Harrison Link to this post

    Good day guys,

    its been 3 days since i posted, is there support on this?

    kind regards


  3. Nencho
    Nencho avatar
    1784 posts

    Posted 18 Oct 2016 Link to this post

    Hello Marc,

    First, I would like to draw your attention to the fact that the dynamically created MultiPage is never added in any Controls collection on your page. This is the main reason for the inability to add and show the needed label.

    I can suggest you to have it statically initialized in your markup, in order to easily position it under the TabStrip.

    In the attachment you can find a sample example on such implementation and adding the needed labels.

    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top