how to keep controls in tabstrip control?

im using a tabstrip control but im not getting how to keep controls in it.
wen im keeping a asp control in it .it is showing a error mess lik dis.
Error Creating Control - TabStrip1Syncfusion.Web.UI.WebControls.Tools.TabItemCollection must have items of type 'Syncfusion.Web.UI.WebControls.Tools.TabStripItem'. 'asp:Label' is of type 'System.Web.UI.WebControls.Label'.
so can anyone please guide me how to keep controls in it.


2 Replies

AD Administrator Syncfusion Team March 24, 2008 06:26 PM UTC

Hi Pavan,

I regret for the delay in getting back to you.

Currently we do not provide any support for adding custom controls inside the TabStrip. The TabStrip can be considered like a panel that is capable of adding TabStripItems to that. The collection of the TabStripItems is called the TabItemCollection. The first set of parent TabStripItems is a set of collection, where, each item contains its own set of Child TabStripItems. In such a collection, you will not be able to add a Label, which is a normal ASP Control.

Please try the below code to understand the same.
[C#]
string str = this.TabStrip1.ID.ToString();
foreach (TabStripItem parenttab in this.TabStrip1.Items)
{
//Returns the first TabStripItem - First Parent Item.
str = str+ "

" + parenttab.ID.ToString();
foreach (TabStripItem childitem in parenttab.Items)
{
//Returns the Child under each parent tab.
str = str + "
" + childitem.ID.ToString();
}
}

Response.Write(str.ToString());

Please try this and let me know if this helps.

Regards,
Nanda




AD Administrator Syncfusion Team March 25, 2008 11:16 AM UTC

Hi,

I regret for the inconvenience caused. If you are trying to insert a Label control to the TabStrip item, you can do this with the help of the Templates.

1. Create and add a TabStripTemplateControl to the TabStrip. Include a template and add a Label control to that. Please refer to the Default.aspx markup in the sample for how to do this.

2. The TemplateID property of TabStripItem can be used to assign this TabStripTemplateControl to the required TabStripItem. You can also do this in code with the following sample snippet.
[C#]
//Adding the template to the first parent tab strip item.
this.TabStrip1.Items[0].TemplateID = "TemplateStrip";


Please refer to the below simple sample that does the same. Please try this and let me know if this helps.
http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/F72429/main.htm

Thank you for your patience.

Regards,
Nanda



Loader.
Up arrow icon