RadComboBoxItem IsEnabled

3 posts, 1 answers
  1. Calin Calin
    Calin Calin avatar
    59 posts
    Member since:
    Mar 2010

    Posted 16 Jun 2010 Link to this post

    Hi,

    I use the following style for a combo box:
    <Style TargetType="telerikInput:RadComboBox" x:Key="comboBoxStyle"
                    <Setter Property="ItemTemplate"
                        <Setter.Value> 
                            <DataTemplate> 
                                <telerikInput:RadComboBoxItem IsEnabled="{Binding Path=IsEnabled}"
                                    <TextBlock Text="{Binding VendorName}" ToolTipService.ToolTip="{Binding Path=Tooltip}" /> 
                                </telerikInput:RadComboBoxItem> 
                            </DataTemplate> 
                        </Setter.Value> 
                    </Setter> 
                </Style> 

    The disabled items appear grayed out in the but I still can select them, is there any way that disable items can't won't be selectable ?

    Thank you,
  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 16 Jun 2010 Link to this post

    Hello,

    You should not put RadComboBoxItem controls in the RadComboBox's ItemTemplate - this is not expected to work. To disable the databound combobox items you could use the same technique as in the following example:
    http://demos.telerik.com/silverlight/#Menu/DataBinding

    It is for RadMenu, but the code will work with very few modifications.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Calin Calin
    Calin Calin avatar
    59 posts
    Member since:
    Mar 2010

    Posted 17 Jun 2010 Link to this post

    Excellent,

    Thank you very much for the answer.

Back to Top