Conditional Hiding of RadComboBoxItem

3 posts, 0 answers
  1. Juliana
    Juliana avatar
    71 posts
    Member since:
    Feb 2008

    Posted 21 Dec 2011 Link to this post

    I have a collection of items. It is bound to two different comboboxes. Is it possible to hide some items in one of the comboboxes?
    I tried smth like
                        <Style TargetType="telerik:RadComboBoxItem">
                            <Setter Property="Visibility" Value="{Binding SomeBooleanProperty, Converter={StaticResource BooleanToVisibilityConverter}}"/>

    But it didn't work out.
    Any directions?

    Best Regards,
  2. Juliana
    Juliana avatar
    71 posts
    Member since:
    Feb 2008

    Posted 17 Jan 2012 Link to this post

    any suggestion?
  3. Gaga
    Gaga avatar
    4 posts
    Member since:
    Oct 2010

    Posted 23 Jan 2012 Link to this post

    Hello Juliana,

    I had similar problem a couple of days ago. This post helped me solve it: How to enable/disable specific items in RadComboBox.

    Long story short. Just make your custom ItemTemplate for RadComboBox:
                    <telerik:ContainerBinding PropertyName="Visibility" Binding="{Binding Enabled, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" />
            <TextBlock Text="{Binding DisplayProperty, Mode=OneWay}" />

    And don't forget to set for proper display RadComboBox settings to (it's replacement for 'DisplayMemeberPath' which does not work with custom item templates):

    I hope this solution will help you too. :)

    Best Regards,
Back to Top