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

RadComboBox Isenabled not working

2 Answers 174 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stu
Top achievements
Rank 1
Stu asked on 22 May 2012, 09:57 AM
Hello,

I have the following RadCombo Box:

<telerik:RadComboBox x:Name="Combo" Grid.Column="2" Grid.ColumnSpan="4" Grid.Row="0"
     VerticalAlignment="Center"
                                     IsEnabled="False"
                                     ItemsSource="{Binding MyList}"
                                     SelectedItem="{Binding selectedItem, Mode=OneWay}"
                                     ItemTemplate="{StaticResource ComboBoxTemplate}"
                                     Command="{Binding SelectedCommand}"
                                     CommandParameter="{Binding Path=SelectedItem, ElementName=Combo }"
                                      />

Setting IsEnabled to false does not effect the combo box at tall.

If I removed the Command and CommandParameter from the RadComboBox then the IsEnabled Property works as expected.

Is there a way / fix / workaround is use the isenabled property when also using a Command / Command Parameter

Many Thanks

2 Answers, 1 is accepted

Sort by
0
Stu
Top achievements
Rank 1
answered on 22 May 2012, 12:16 PM
I found the issue.

It appear that if you have set the command parameter then the commands CanExecute method will override the isenabled / isreadonly properties.

I just have to add some logical to my CanExecute to handle the enabling / disabling.
0
Sergiy
Top achievements
Rank 1
answered on 07 Mar 2013, 01:00 PM
Thanks a lot, it's working for me
Tags
ComboBox
Asked by
Stu
Top achievements
Rank 1
Answers by
Stu
Top achievements
Rank 1
Sergiy
Top achievements
Rank 1
Share this question
or