I am using WPF having a strange issue with RadListBox SelectedItem databinding, trying to figure out but no luck. Following is my scenario
I am using Telerik Controls (RadListBox, and RadButton)
RadButton is placed inside a ItemsControl, RadListBox and ItemsControl are bind to sameItemsSource.
I am using PRISM and MVVM.
What I want is when I click on button, the same item is selected from RadListBox automatically,(This part working fine).
Problem: As soon as I click on any item of RadListBox and then click back on any button the item selection stops working.
Even more strange thing: I tried the same thing with standard WPF ListBox by adding attached behavior for selection changed event and attached property of Command and CommandParameter, it works fine, so it looks like an issue with Telerik RadListBox ?
Now let me come to code.
public class MainViewModel : INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
// Create the OnPropertyChanged method to raise the event
<!-- The above debug converter is just for testing binding, as long as I keep on clicking button the Converter is being called, but the moment I click on RadListBoxItem the Converter is not called anymore, even when I click back on buttons -->
Thanks Yana, for your help, yes it worked, but I am surprised, why two way binding is required in this case, as I only need binding from Source to Target not from Target to Source as Viewmodel is being updated from the Command delegate StudentSelected
when we click on list box item? and Microsoft's WPF ListBox worked with OneWay binding?