Windows Form: Displaying the value of a child in a DataGridView

I have a productVariant object that has a child product object. I want to show the value in a DataGridView, can anyone let me know how to do this?

Here is the structure of the object.

alt text

I tried to associate "ProductVariant.Product.Name" with the name DataProptertyName in the DataGridView, however it did not show any value.

Can anyone help with this? Many thanks.

+3
source share
2 answers

DataGridView controls cannot automatically bind child objects.

If you work with Win-forms, my suggestion would be to create two dialog boxes.

( DGV), ( DGV).

, DGV.

, , , DGV .

, , -. , , , .. .

, HierarchicalDataGridView.

0

WinForms , WPF . WinForms - ( , ), , , - , .

TypeDescriptor PropertyDescriptor, . , , .

0

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


All Articles