I am unable to bind to the SelectedItem attribute in RadGridView. It ends with errors on page.
The code below works with an ordinary ListBox control.
I am using VMMV models to avoid too much code in the code-behind files. Everything is bound together using the ninject.
I do not want to use the selecttion changed event.
Are you able to see the problem?
DataContext
="{Binding Path=AttributeViewModel, Source={StaticResource serviceLocator}}"
<telerikGridView:RadGridView
IsReadOnly="True" ColumnsWidthMode="Auto" AutoGenerateColumns="False"
ItemsSource="{Binding Path=AttributeTypes, Mode=OneWay}"
SelectedItem="{Binding Path=SelectedAttributeType, Mode=TwoWay}">
<telerikGridView:RadGridView.Columns>
<
TextBlock Text="{Binding SelectedAttributeType.Name}" />
public AttributeType SelectedAttributeType
{
get { return selectedAttributeType; }
set
{
if (selectedAttributeType != value && value != null)
{
selectedAttributeType =
value;
RaisePropertyChanged(
"SelectedAttributeType");
}
}
}
Regards
Vidar Steen