Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2690
Combo and IValueconverter
posted

I have combo as

 <ig:XamComboEditor Name="YComboEditor"   ItemsSource="{Binding Path=YearsData}"  
            DisplayMemberPath="SomeYear"   
            SelectionChanged="YComboEditor_SelectionChanged"    
            SelectedItem="{Binding SomeYear,Mode=TwoWay,Converter={StaticResource YearConverter}}">

 </ig:XamComboEditor>

This is populated correctly

I have IvalueConverter which checkes for the year and then should return current year as selected

For some reason the IValueconverter is not triggered

Any ideas?

Parents
  • 6759
    Offline posted

    Hi,

    in order for the ValueConverter to be triggered a valid binding should be used so the ValueConverter will have something to convert from/to. Is "SomeYear" valid binding target in your view model?

    Looking at your xaml I am get the impression(the path for your SelectedItem binding is the same as the DisplayMemeberPath string) that you are trying to bind to a property of an ItemSource's item. Generally you should bind SelectedItem to a valid binding target.

    You could check this sample which is showing how xamComboEditor is used with value converter in SelectedItem binding.

     

    Regards

Reply Children