
XAML:
<telerik:RadGridView Grid.ColumnSpan="2" SelectedItem="{Binding Path=WorkingMedicationOrder.DrugDosage_, Mode=TwoWay}" ItemsSource="{Binding DrugDosages}" Grid.Row="5" AutoGenerateColumns="False" ShowGroupPanel="False"> |
WorkingMedicationOrder.DrugDosage_ =
null;
Thanks,
5 Answers, 1 is accepted
I have prepared a small sample project trying to reproduce what you have described but I could not. My project uses the latest internal build and when I set null to the property from the view model the grid selection is cleared.
Can you give it a spin on your end and see whether it will work. Another option is to modify it in a way to reproduce the issue you are faced with and send it back.
Sincerely yours,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

private
void
OnClearSelected(
object
sender, RoutedEventArgs e)<br>{<br>
this
.viewModel.SelectedClub =
new
Club(
"LAURA"
, DateTime.Now, 5);<br>}
Thanks,
LauraH
Pardon me if I have misunderstood your question, but if I understand this correctly, you are creating a brand new object and then assigning it as the SelectedItem of RadGridView. Since you have just created this brand new object, it is not part of the source collection of RadGridView in any way. RadGridView only shows items that are part of its source collection.
How should RadGridView select an item, which is not part of its source collection and is not displayed in RadGridView in any way? Which row should RadGridView select as a result of this source code you have provided?
What happens if you do the same thing with a plain stock ListBox?
Could you please elaborate what is the behaviour that you expect given the source code that you provided?
Ross
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Thanks!
LauraH
Here you can learn more about selection. Basically, selection works just like any other possible selection out there.
Let us know if you have any particular questions.
Ross
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>