Hi there,
I am using a RadGridView, here is the XAML
As you can see I am binding the selected item, I followed the example from the code download in this (http://www.telerik.com/community/forums/wpf/gridview/select-a-row-from-viewmodel.aspx) post. I works the first time no problem... I put a breakpoint in my view model and I can see my SelectedModel getting set. The problem is that I can't unselect the first item and have it set the second item. At this point I am stuck - here is the pertinent code from the view model.
What is does is keeps highlighting rows - even though I have SelectionMode="sinlge" - Uhm? Any suggestions? I attached a screen capture to show what I mean - see all the highlighted rows?
Thanks!
** Also - The only difference I can see between my project and the sample is that we are "Target Framework:" is set to ".NET Framework 4" and your project is being built as ".NET Framework 4 Client Profile"
I am using a RadGridView, here is the XAML
<
telerik:RadGridView
Grid.Row
=
"1"
Grid.ColumnSpan
=
"3"
SelectionMode
=
"Single"
IsReadOnly
=
"True"
Name
=
"radGridView1"
ItemsSource
=
"{Binding Path=ModelCodeList}"
SelectedItem
=
"{Binding Path=SelectedModel, Mode=TwoWay}"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Code}"
Header
=
"Model"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ID}"
Header
=
"ID"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding OemName}"
Header
=
"OEM Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ModalityCode}"
Header
=
"Modality Code"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Active}"
Header
=
"Model Active"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
As you can see I am binding the selected item, I followed the example from the code download in this (http://www.telerik.com/community/forums/wpf/gridview/select-a-row-from-viewmodel.aspx) post. I works the first time no problem... I put a breakpoint in my view model and I can see my SelectedModel getting set. The problem is that I can't unselect the first item and have it set the second item. At this point I am stuck - here is the pertinent code from the view model.
public
Model SelectedModel
{
get
{
return
selectedModel; }
set
{
if
(selectedModel != value)
{
selectedModel = value;
}
RaisePropertyChanged(() =>
this
.SelectedModel);
AddSelectedModelCommand.RaiseCanExecuteChanged();
}
}
What is does is keeps highlighting rows - even though I have SelectionMode="sinlge" - Uhm? Any suggestions? I attached a screen capture to show what I mean - see all the highlighted rows?
Thanks!
** Also - The only difference I can see between my project and the sample is that we are "Target Framework:" is set to ".NET Framework 4" and your project is being built as ".NET Framework 4 Client Profile"