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

RadComboBoxItem IsEnabled

2 Answers 57 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Calin Calin
Top achievements
Rank 1
Calin Calin asked on 16 Jun 2010, 11:16 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 16 Jun 2010, 12:08 PM
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.
0
Calin Calin
Top achievements
Rank 1
answered on 17 Jun 2010, 07:09 AM
Excellent,

Thank you very much for the answer.

Tags
ComboBox
Asked by
Calin Calin
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Calin Calin
Top achievements
Rank 1
Share this question
or