Hello Sam Ur,
The HeaderTemplate property is applied whenever the Header property is set to a value that has no visual representation, like for example a data object. It is used in cases when the TabControl ItemsSourse collection is bound to a business collection
So in your case, if you bind your TabControl to a business collection that implements the INotifyCollectionChanged
interface, you will be able to add and remove items from that collection thus reflecting the RadTabControl Items collection as well. You can examine this approach in the attached example.
However, since I am not sure what exactly are the specifications of your scenario, I don't know if this approach will suit you. Still, in your example, if you add your TabItems in code behind, like illustrated in the code snippet, you will have to define a Binding for the RadTabItem Header element in order to apply the HeaderTemplate. Otherwise, the Header element will contain a string (
) and won't need to look for a template to decide how to visualize it.
I hope this information helps. Still, if you need more info, please let us know.
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>