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

2 posts, 0 answers
  1. Yaroslav
    Yaroslav avatar
    153 posts
    Member since:
    Jan 2016

    Posted 31 Jan 2017 Link to this post

    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.

  2. Stefan
    Stefan avatar
    901 posts

    Posted 03 Feb 2017 Link to this post

    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.

    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.
Back to Top