Displaying linked data in grid

Seems like this would be a common requirement but I can't seem to find the proper documentation for it.

In a DataGrid listing, for example, Orders with a CustomerID field, how do I show the customer name instead of the CustomerID in a column? Or, for the OrderDetails listing, show the product name instead of the ProductID?

There is an "expand" parameter in "Invoke data source method" in the "LoadData" action that looks like it might be for that purpose, but I can't find any documentation on how it works or how to use it.

Thanks, Dan

Well, maybe I didn't ask this correctly. I'm still trying to figure this out.

I did find this article on dotnet and am assuming Radzen uses the same principal.

If that's the case, the database needs the correct relations defined so that dotnet knows what they are and how to structure the query.

So, I added a foreign key constraint in the database (MSSQL), but it still doesn't work. Doesn't seem like Radzen has picked up that change. Do I need to re-run the data connection somehow?
Am I on the right track? Can someone help me out?

Thanks, Dan

if you update the database schema you will need to go to the data source and click Infer Schema to update the Radzen data model

OK thanks for verifying that. I did that and it seems to be working now.

So, next question is, how do I get the sort and filter functions to work? It is displaying the correct value now (Employee.FullName), but the filter and sort don't work, probably because the Employee.FullName is a NotMapped field so isn't in the database. How do I go about sorting/filtering on the column value?

If you’re using the Radzen app try adding Employee.FullName to the sort field and filter field in the data grid column. Then you should be able to sort and filter.

There is a thread which is quite similar: Calculated fields on the server side

Thanks @korchev, I'll check that out when I have a chance. So far, I have it working except for the filter/sort functions, so I'll see if this helps me get that working.