We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Display child object data

I have an object, called order, like this

public class Order

{

public int OrderId {get; set;}

public OrderLine orderLine {get; set;}

}


public class OrderLine

{

public int OrderId {get; set;}

public string product {get; set;}

}

In my grid, I want to show the OrderId and the product from the OrderLine. I thought it would be as simple as

<GridColumn Field=@nameof(Order.orderLine.product) />

but that just comes up empty. What do I need


3 Replies 1 reply marked as answer

KG Keerthana Ganesan Syncfusion Team October 28, 2022 03:35 AM UTC

Hi Peter,

Greetings from Syncfusion support.

We have analyzed your query and we suggest you use GridForeignColumn to achieve your requirement. We have discussed this topic in detail in our UG documentation. Kindly refer to the attached document link for your reference.

Reference link: https://blazor.syncfusion.com/documentation/datagrid/columns#foreign-key-column

Kindly get back to us if you have any further queries.


Regards,

Keerthana.


Marked as answer

PE Peter October 28, 2022 09:39 AM UTC

Hi Keerthana


Thanks for your prompt response, it is greatly appreciated.  Your solution also fixed my problem, so thanks as well for that!


Kindest regards


Peter



SG Suganya Gopinath Syncfusion Team October 28, 2022 07:44 PM UTC

Hi Peter,

We are glad that the provided solution worked to solve the issue. Please get back to us if you have any other queries in future. 

Regards,

Suganya Gopinath.


Loader.
Live Chat Icon For mobile
Up arrow icon