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

RadTabItem

1 Answer 98 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jether
Top achievements
Rank 1
Jether asked on 17 May 2011, 08:56 PM
I need to load the contents of a RadTabItem dynamically from a url. How do I do?

RadTabItem itemToAdd = new RadTabItem()
          {
              Header = _Header             
          };
 
          //itemToAdd.Content = Application.LoadComponent(new Uri("",UriKind.Relative),"assemlyName;component/test.xaml");
          itemToAdd.Content = new Uri("/Pages/ThatPage.xaml", UriKind.Relative);
            
          tabAcoes.Items.Add(itemToAdd);
      }

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 20 May 2011, 12:23 PM
Hello Jether,

From the code snippet you sent I take it that the URL page you want to add to the RadTabItem.Content is basically a UserControl. Is that the case?

If it is, you don't need to use a URL to add it to the RadTabItem. You can add it like so:
RadTabItem itemToAdd = new RadTabItem()
          {
              Header = _Header            
          };
 
itemToAdd.Content = new ThatPage();
             
tabAcoes.Items.Add(itemToAdd);
You can fine more info about how to add UserControls to your main page here. I hope this will help you.

Kind regards,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabControl
Asked by
Jether
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or