Display child object properties in Datagridview

How can I display the selected properties of a datagridview object as well as the selected properties of a member object of this first object? I think that I will not require binding, but rely on hard updates for coding, because updates will be triggered on threads other than the UI, and I think it will not be so easy to bind. At least I had problems with this in another project.

I am mainly looking to understand how I can do this. Perhaps with LINQ or something else. Note. I want to display data in one table. Since child / parent is a 1: 1 ratio.

So, an example code:

Public Class User
public property Score as Integer
public property Details as UserDetails
End Class

Public Class UserDetails
public property Name as String
public property userName as String
End Class

Therefore, I want the table to display the columns: Score, Name, UserName


EDIT: , , , , :

Dim q = (From n in userList Select New With {n.Score, n.Details.Name, n.Details.userName}).ToArray
+3
2

:

Dim q = (From n in userList Select New With {n.Score, n.Details.Name, n.Details.userName}).ToArray
+1

, ITypedList, .

ITypedList , , IME. , , ITypedList

+2

Source: https://habr.com/ru/post/1781307/


All Articles