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

Header TabItem on run time

1 Answer 72 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
ayala
Top achievements
Rank 1
ayala asked on 08 Mar 2009, 11:34 AM

I want to define the header tab item on run time, how can I do it? 

I tried to do this:

TabItem

newTab = new TabItem();

 

newTab.Header = headerName; 

 

tabControl.Items.Add(newTab);
but it didn't work!

what can I do?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 09 Mar 2009, 07:14 PM
Hey ayala,

Give this a try, it works for me in my application:

RadTabItem rti = new RadTabItem();  
rti.Header = "Report";  
// make a stackpanel called newStack, fill it with stuff  
rti.Content = newStack;  
RadTabUno.Items.Add(rti);  
 

Let me know if that works for you!

Tags
TabControl
Asked by
ayala
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Share this question
or