This question is locked. New answers and comments are not allowed.
Hi
I have succesfully bound an array to a gridview (see screenshot). However I am not able to bind the selected Grid item to the PropertyGrid. Is is because of the array? If I need to do some code-behind can you provide a code snippet.
Thanks
Rich
XAML follows:
I have succesfully bound an array to a gridview (see screenshot). However I am not able to bind the selected Grid item to the PropertyGrid. Is is because of the array? If I need to do some code-behind can you provide a code snippet.
Thanks
Rich
XAML follows:
<
UserControl
x:Class
=
"RadGridView_SL4_AR_25.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:my
=
"clr-namespace:RadGridView_SL4_AR_25"
xmlns:telerikQuickStart
=
"clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
mc:Ignorable
=
"d"
d:DesignHeight
=
"700"
d:DesignWidth
=
"700"
>
<
UserControl.Resources
>
<
my:MyViewModel
x:Key
=
"MyViewModel"
/>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
DataContext
=
"{StaticResource MyViewModel}"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"350"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadGridView
Name
=
"myGrid"
ItemsSource
=
"{Binding GridItems, Mode=TwoWay}"
SelectionChanged
=
"myGrid_SelectionChanged"
CanUserSortColumns
=
"True"
IsReadOnly
=
"True"
ShowGroupPanel
=
"True"
Loaded
=
"myGrid_Loaded"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Columns[0]}"
Header
=
"Name"
UniqueName
=
"Customer_Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Columns[1]}"
Header
=
"Street"
UniqueName
=
"Customer_Street"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Columns[2]}"
Header
=
"City"
UniqueName
=
"Customer_City"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Columns[3]}"
Header
=
"State"
UniqueName
=
"Customer_State"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Columns[4]}"
Header
=
"Zip Code"
UniqueName
=
"Customer_ZipCode"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
telerik:RadPropertyGrid
x:Name
=
"RadPropertyGrid1"
Item
=
"{Binding SelectedItem, ElementName=myGrid, Mode=TwoWay}"
Margin
=
"8"
LabelColumnWidth
=
"130"
Grid.Column
=
"1"
AutoGeneratePropertyDefinitions
=
"False"
>
<
telerik:RadPropertyGrid.PropertyDefinitions
>
<
telerik:PropertyDefinition
DisplayName
=
"Name"
Binding
=
"{Binding Columns[0]}"
/>
<
telerik:PropertyDefinition
DisplayName
=
"Street"
Binding
=
"{Binding Columns[1]}"
/>
<
telerik:PropertyDefinition
DisplayName
=
"City"
Binding
=
"{Binding Columns[2]}"
/>
<
telerik:PropertyDefinition
DisplayName
=
"State"
Binding
=
"{Binding Columns[3]}"
/>
<
telerik:PropertyDefinition
DisplayName
=
"Postal Code"
Binding
=
"{Binding Columns[4]}"
/>
</
telerik:RadPropertyGrid.PropertyDefinitions
>
</
telerik:RadPropertyGrid
>
</
Grid
>
</
UserControl
>