Enabling/Disabling a Tab in a TabStrip

Y

Yuki

Hi all!
I put a TabStrip in my webform, and, in some events, I need to disable some
Tabs in the TabStrip... I try this:
Microsoft.Web.UI.WebControls.Tab t;
t = (Microsoft.Web.UI.WebControls.Tab)this.mpMy.FindControl("tab1");

but I have a error:
Cannot convert type 'System.Web.UI.Control' to
'Microsoft.Web.UI.WebControls.Tab'

any ideas?

TIA, Yuki!
 
C

CaffieneRush

I cannot see that Tab is the child or descendent class of
System.Web.UI.Control.
It's inheritance goes like this, Object->BaseChildNode->TabItem->Tab.
So you cannot use FindControl() for locating a Tab at runtime.

However TabStrip does inherit from Control so you can use FindControl
to locate that and examine it's Items collection for your tab, then
disable your tab.

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top