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

Re-order tabs programmatically

2 Answers 91 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Petter
Top achievements
Rank 1
Petter asked on 20 Feb 2014, 11:30 PM
Hi,

I need to re-order my tabs programmatically. Is this possible and if so how? If not, is there a workaround?

I have searched the telerik forums and carefully read the documentation, but haven't found it described anywhere.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 25 Feb 2014, 08:52 AM
Hello Petter,

In order to reorder the Items of the RadTabControl you need to use MVVM approach and populate the items through the ItemsSource property. Once you have created the collection holding the business objects representing the TabItems you can reorder them by simply removing the items from the collection and inserting it in a different position in the same collection.

I have attached a sample project demonstrating the above approach for your convenience.

I hope this information helps.

Kind regards,
Kiril Vandov
Telerik
0
Petter
Top achievements
Rank 1
answered on 25 Feb 2014, 08:11 PM
Hi Kiril,

Thanks for your response and the sample.

I finally solved this with another workaround: by creating two overlapping tab controls (one with 1 tab and the second one with 2) and used the Visibility property on the tab control.

Kind regards
Tags
TabControl
Asked by
Petter
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Petter
Top achievements
Rank 1
Share this question
or