What I want to do is to display Customername next to Customernumber in Orders grid like so:
Ordernumber,Orderdate,Customernumber,Customername
123, 30.12.2018, 1000, Peter
I have add new column to grid in Orders-Page but I dont know how to display Customers.Customername using Order.Customernumber
Infer your data source first so Radzen knows about the new foreign key relationship:
Go to the data screen
Click on your data source
Click Infer and Next.
Then you can delete the existing DataGrid and add a new one. Use the "New ..." option from the Data property dropdown to configure the grid. It will allow you to pick columns and should automatically display the CustomerName column.
But if I delete the grid then I will lose all changes that I have made to that grid, for example I have changed all column-widths and changed all column-titles and column-order...so when I delete the grid then I have to do all changes again ?
Yes, you will lose those changes. You can try the following instead (which the grid data-binding wizard does automatically otherwise):
Find the Invoke method which calls getOrders. There should be one or two instances - one in the Load event of the page and one in the LoadData event of the DataGrid.
Set the $expand parameter of the getOrders method to Customer (in all invokes of the getOrders method).
Add a new column to your data grid and set its Template property to ${data.Customer.Customername}
In the screenshot you use rowexpand, in previous example LoadData event of page and grid was used.
I dont know if rowexpand is correct for my problem because I think that I have no rows to expand.... I have 2 separat grids that are bound together using one:many relationship.
I will try to explain :
I have two tables : ProductionOrders and ProductionOrdersDetails
I have a page with 2 grids
grid0: displays all ProductionOrders
grid1: display ProductionOrdersDetails of selected row in grid0
This works.
In grid1 I have employeeNumber.
But now I must display additional column in grid1.
This column must get its data from table "employees" using employeeNumber and read employeeName and display employeeName in grid1
I send screenshot, maybe it helps to understand what I try to do.
This usually means that some error has occurred. You can check Radzen's output window for any server-side exceptions. Most probably something isn't spelled right.
Maybe the problem is that there is no relationsship between the first grid (this grid displays data of table "Productionorders") and Employee table?
Such relationsship does only exist for the second grid (this grid displays data of table "ProductionorderDetails"), there I have a foreign key to Employee table
So it seems that on Page LoadData event when I do $expand=Employee there is a relationsship missing?
If so, how can I fix it without creating relationsship between Productionorders and Employee ?
Yes, you need a relationship at DB level (foreign key constraint) in order for the $expand parameter to work. If you don't have such a relationship you have to use the approach I have described in your other thread.