RadGridView with LINQ and two DataSources (Master/Detail)

0 Answers 21 Views
GridView
Frank
Top achievements
Rank 1
Frank asked on 21 Jun 2022, 09:45 AM

Hello,
I'm using the RadGridView tool (WPF) and I'm having problems integrating my data sources there.
I am using LINQ to query two tables, something like this:

TableMaster = from tabM in EntitiesObject.TableMaster 
                        select tabM;
TableDetails = from tabD in EntitiesObject.TableDetails
                               where tabD.Description.Contains(SearchCriteria)
                               select tabD;

How can I display / bind these two tables in the RadGridView control as MasterDetail?

I am using Telerik UI for WPF R1 2022 SP1 :)

Greetings,

Frank
Martin Ivanov
Telerik team
commented on 23 Jun 2022, 12:50 PM

RadGridView works with a single data source, so in order to achieve your requirement you will need to combine both data source into one. You can see how to assign a DataTable to the GridView control here: https://docs.telerik.com/devtools/wpf/controls/radgridview/populating-with-data/binding-to-a-datatable. You can also check the other articles in the Populating with Data section in the documentation.

Also, for the master-detail layout you can take a look at the row details feature.

Frank
Top achievements
Rank 1
commented on 27 Jun 2022, 08:01 AM

Thanks Martin. 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Frank
Top achievements
Rank 1
Share this question
or