How to Join two Database Tables in one DataGrid

From what I understand, I need to use the expand option in the query builder to join 2 tables and use the data e.g. in a datagrid component. But where do I put the attribute, that the join of the 2 tables has to be applied on?

When I add the table in the expand option and add the columns manually, they won't show in the resulting table. I believe, that something is wrong in the following line for a column in the "expanded" table DboObjekte:

<RadzenDataGridColumn TItem="ABschein.Models.ArbeitsscheinDB.DboObjekte" Property="Obj_Kunden_Nr" Title="Firmen Nr" />

The columns of the table DboArbeitsschein, that are shown look like this:

<RadzenDataGridColumn TItem="ABschein.Models.ArbeitsscheinDB.DboArbeitsschein" Property="AS_Objekt_Nr" Title="Objekt Nr" />

What is the correct step by step procedure to create a datagrid component and populate it with content from 2 different joined tables?

First you need to make sure that you have a relationship built between the two tables, then in the query, use the expand option to list the tables you want to get values from. When you create a grid column, the property dropdown will not display the columns in the expanded table, but you can still apply them like this expandedtable.column. Your other option is to use a templet in the grid column and give it a context name ie...Context="somecontextname", then you can add any components you want, such as a radzentext and you will get a context option (with the name of your Context. In there you will see the expanded table and can select columns from it.

1 Like

Thank you. Adding the table to the Property did the trick for me.