This question is locked. New answers and comments are not allowed.
Hello,
I'm experiencing strange issue with RadListPicker.
This is how the xaml part looks like:
<telerikInput:RadListPicker
ItemsSource="{Binding AvailableUsers}" SelectedItem="{Binding SelectedUser, Mode=TwoWay}"
DisplayMemberPath="Login"
NoSelectionContent="Select user..."
/>
The control is bound to ViewModel, which contains two properties: observable collection "AvailableUsers", and "SelectedUser" of proper type.
On every page load collection is being populated with data which comes from web service.
At the initial page load everything works fine, but when I navigate away and then come back, I'm getting "SelectedItem is not contained within the ItemsSource" error.
This is how the code looks like:
AvailableUsers = null;
SelectedUser = null;
AvailableUsers = e.Result; //<-- this throws Exception
e.Result is data from web service containing collection of users. The last line throws Exception and when the debugger stops in this point I can see that SelectedUser is not null (take a look at my attached screenshot).
So when this happens app continues to run, but list picker displays "Select user..." string - as if there was no selection. When I select an item, viewmodel is being notifed but control still displays "Select user..." you can't see the change.
The issue is quite tricky, I tried to make simplified test solution with similar scenario, but was unable to get the error.
Any ideas?
I'm experiencing strange issue with RadListPicker.
This is how the xaml part looks like:
<telerikInput:RadListPicker
ItemsSource="{Binding AvailableUsers}" SelectedItem="{Binding SelectedUser, Mode=TwoWay}"
DisplayMemberPath="Login"
NoSelectionContent="Select user..."
/>
The control is bound to ViewModel, which contains two properties: observable collection "AvailableUsers", and "SelectedUser" of proper type.
On every page load collection is being populated with data which comes from web service.
At the initial page load everything works fine, but when I navigate away and then come back, I'm getting "SelectedItem is not contained within the ItemsSource" error.
This is how the code looks like:
AvailableUsers = null;
SelectedUser = null;
AvailableUsers = e.Result; //<-- this throws Exception
e.Result is data from web service containing collection of users. The last line throws Exception and when the debugger stops in this point I can see that SelectedUser is not null (take a look at my attached screenshot).
So when this happens app continues to run, but list picker displays "Select user..." string - as if there was no selection. When I select an item, viewmodel is being notifed but control still displays "Select user..." you can't see the change.
The issue is quite tricky, I tried to make simplified test solution with similar scenario, but was unable to get the error.
Any ideas?