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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add programmatically a column of a nested object

Thread ID:

Created:

Updated:

Platform:

Replies:

144009 Apr 14,2019 12:47 PM UTC Apr 22,2019 06:40 AM UTC WinForms 3
loading
Tags: SfDataGrid
Rafael
Asked On April 14, 2019 12:47 PM UTC

Hi there.

I have a sfDaaGrid showing a list a cities and a I want to show the state that city belongs. I would prefer not to use a master-detail view, just add another column mapping "city.state.name".

Something like this:
ID     CITY            STATE
1       New York     NY 

Is that possible?

Thanks for the help!

Jagadeesan Pichaimuthu [Syncfusion]
Replied On April 15, 2019 10:51 AM UTC

Hi Rafael, 

Thanks for using Syncfusion product. 

You can able to add the column which is in nested object by using the below code snippet for your reference. 

sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "Category.CategoryName" });   

And also you can refer the below forum to achieve your requirement in both programmatic and auto generated columns.  

If we misunderstood your requirement, please provide more information regarding the requirement. This would help us to proceed further. 

Regards, 
Jagadeesan

Rafael
Replied On April 20, 2019 09:54 AM UTC

Hi Jagadeesan,

Sorry for my late response. It worked just fine, thank you so much.

Jagadeesan Pichaimuthu [Syncfusion]
Replied On April 22, 2019 06:40 AM UTC

Hi Rafael, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Jagadeesan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon