Rank: Member Groups: Member
Joined: 8/13/2007 Posts: 10
|
Hello,
I have a problem with Tabstrip component.
I'm using it in a page for selecting different tabs.
Tabstrip has set RaisesServerEvent to true.
I want to know which tab was selected when the page is postbacked. For that I use SelectedIndex property of Tabstrip instance.
Everything works good in case of I create tabs (items) manually in a design time.
When I try to add my tabs dynamically when the page is postbacked I get SelectedIndex to -1.
The construction for adding tabs is:
Tabstrip1.Items.Add ("New item");
Thank you fro your help.
Best regards.
Milan Kotaska
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This usually occurs when you recreated your tab items on every page request. In that case you are clearing all items which would also reset the SelectedIndex.
Try to put your code inside if (!Page.IsPostBack) and see if that works. If that still does not work, please try to isolate the problem into a separate test page and post the full test page. We will be happy to take a look once we have that.
Thanks!
|
Rank: Member Groups: Member
Joined: 8/13/2007 Posts: 10
|
Hello,
thank you very very much. It helped.
|