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

How to implement 3-level master/detail using QueryableEntityCollectionView and RadGridView in MVVM application?

1 Answer 120 Views
EntityFrameworkDataSource
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 31 Jan 2017, 12:27 PM

Hello. I have a database on MS SQL Server 2014 Express LocalDB. Lets call this database 'My_Db'. My_Db database has the folowing hierarchy: highest-level master table called 'Devices' has 'Id' field that is primary key. Devices table has one detail table called 'SavedSessions" which has 'Id' field that is primary key and 'Devices_Id' field that is foreign key referenced to Devices.Id field. SavedSesions table has (in its turn) two detail tables: SavedSessionEventLogs and SavedSessionRegisters. Each one of this last two tables has 'SavedSessions_Id' field which is foreign key referenced to SavedSessions.Id field. In my client WPF MVVM application I need to display  these four tables in master/detail hierarchy but this herarchy must not be nested. So each of this table must be displayed in its own grid (for example RadGridView). So if I select record in Device table' grid then content of SavedSession table' grid must be accordingly changed and the first record must be selected there. This accordingly entails the appropriate changing of content of SavedSessionEventLogs and SavedSessionRegisters tables. I want to build this master/detail view using QueryableEntityCollectionView and four instance of RadGridView. I had browsed many appropriate information in Google but not found any useful information. So I'll be very grateful if you give me an example of such an application.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Feb 2017, 09:40 AM
Hi Yaroslav,

In order to satisfy such requirement, you can utilize the selection mechanism of RadGridView. Since you need to set the source collection of a given RadGridView instance based on the selection of the previous one, you can benefit from the SelectionChanged event. If you need to perform this operation in the view model instead, you can use the SelectedItem property of the control.

Hopefully, this helps.

Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
EntityFrameworkDataSource
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or