This question is locked. New answers and comments are not allowed.
I have declared a combobox as below by attaching a command: But it is not working. But when I attach DropDownOpened event it works for me. Please help.
<telerikInput:RadComboBox Width="50" Height="20" app:RateTableViewModel.Command="{Binding Path=TelrikComboChange}" > |
<ComboBoxItem Content="Balance"/> |
<ComboBoxItem Content="Fee"/> |
<ComboBoxItem Content="Age"/> |
</telerikInput:RadComboBox> |
And in the viewModel i have the commandPropertyChange as below:
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) |
{ |
if (d is RadComboBox) |
{ |
RadComboBox b = d as RadComboBox; |
ICommand c = e.NewValue as ICommand; |
b.SelectionChanged += delegate(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs arg) { c.Execute(null); }; |
} |
} |
public ICommand TelrikComboChange |
{ |
get |
{ |
return new RelayCommand(param => TelrikComboChange_Executed()); |
} |
} |
void TelrikComboChange_Executed() |
{ |
MessageBox.Show("Hello"); |
} |