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

Setting/getting ID of Tabs

4 Answers 36 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Patrik Johansson
Top achievements
Rank 1
Patrik Johansson asked on 29 Mar 2011, 12:17 PM
Maybe I'm blind but I can't seem to find how to set and get ID of Tabs, thus making it much easier and more secure to control selection etc. via code, since using Indexes would most likely break if you reorder the tabs. Surely, there must be such an option? Currently, we are using the PageViewID as a substitute for this (as well as controlling the RadMultiView) but this requires the use of foreach() everywhere...

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 29 Mar 2011, 01:31 PM
Hello Patrik,

According to Telerik documentation, the ID property for the RadTab is for internal use only.

You can use the RadTab's value property. It's better than the PageViewID, since you can select a tab by its value, FindTabByValue. You can then hold the PageViewID for the control you want and use the RadMultiPage's FindPageViewByID method, to get the corresponding PageView control and select it.

I hope that helps.
0
Patrik Johansson
Top achievements
Rank 1
answered on 29 Mar 2011, 03:05 PM
Thanks for your answer.

What we did was actually something like this:

if (theTab.PageViewID == "radPageViewCustomerService")

so we still used the PageViewID to feed the RadMultiView, but using the Value seems a much better choice if there is a FindTabByValue which I have to be honest and admit I was not aware of. 
0
Kate
Telerik team
answered on 01 Apr 2011, 11:06 AM
Hello Patrik Johansson,

Please take a look at the following help article: RadTabStrip:FindTabByValue Method

Greetings,
Kate
the Telerik team
0
Patrik Johansson
Top achievements
Rank 1
answered on 01 Apr 2011, 11:12 AM
Thanks, we have already change to using the FindTabByID method, but it's good help for others who might be reading this.
Tags
TabStrip
Asked by
Patrik Johansson
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Patrik Johansson
Top achievements
Rank 1
Kate
Telerik team
Share this question
or