Conditional icon visibility in Tab Header

3 posts, 0 answers
  1. Simon
    Simon avatar
    23 posts
    Member since:
    Apr 2012

    Posted 01 Jun 2012 Link to this post

    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. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 06 Jun 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Simon
    Simon avatar
    23 posts
    Member since:
    Apr 2012

    Posted 06 Jun 2012 Link to this post

    Thanks, I will give this a try.

    Cheers,

    Simon
Back to Top