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

Conditional icon visibility in Tab Header

2 Answers 39 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 01 Jun 2012, 10:49 PM
Hello,

I have a TabControl whos ItemsSource is bound to an ObservableCollection of some view model. The view model contains an "IsReadOnly" property. I would like to show an icon (a lock of some kind) on the tab header items that are bound to view models with IsReadOnly flag set to true. How would I go about this?

While I am at it, how would I go about setting the same width for all tab items? They are bound to a string property from the same view model.

Many thanks,

Simon

2 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 06 Jun 2012, 06:47 AM
Hello Simon,

 I would suggest you to use the ItemTemplateSelector property and have two different DataTemplates for the read-only/locked and normal tab. You may have a look at this help article. You may also have a look at this example code - http://demos.telerik.com/silverlight/#TabControl/Databinding.
Please let us know if the ItemTemplateSelector works for you. 

All the best,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Simon
Top achievements
Rank 1
answered on 06 Jun 2012, 02:58 PM
Thanks, I will give this a try.

Cheers,

Simon
Tags
TabControl
Asked by
Simon
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Simon
Top achievements
Rank 1
Share this question
or