This is a migrated thread and some comments may be shown as answers.

[Solved] Link the GridView row SelectionChanged to display data in anaother view.

1 Answer 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HDD
Top achievements
Rank 1
HDD asked on 16 Sep 2010, 10:37 PM
Here's what I am trying to achieve.
My view "MainPage.xaml" has its viewmodel "MainPageViewModel.cs" and is divided into two vertical section.
I have a one column radgridview on the left section which displays the "Names" of the players from the "Player" class.
I have another view "PlayersInterest.xaml" which is actually embedded/injected in the right section of the  "MainPage.xaml" view.
This view "PlayersInterest.xaml" has few textblocks to display the various interests of the players.

I want to share the viewmodel "MainPageViewModel.cs" of "MainPage.xaml" with the "PlayersInterest.xaml" view and let the "PlayersInterest.xaml" view display the interests of the selected player from the gridview on the left section.
Also, the bindings for the "PlayersInterest.xaml" view has to be a two way, that is I need to modify and save the player's interests too.
Any guidance or pointers on this.
Thanks in advance
HDD

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 17 Sep 2010, 10:16 AM
Hi HDD,

All you need to do is to expose a property in your ViewModel bound to the SelectedItem of the grid and set the Details Property of that item as ItemsSource for you second controls.
I am sending you a sample project illustrating the proposed solution.
 

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
HDD
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or