N
N
Nikolai2021-04-21 22:14:42
C++ / C#
Nikolai, 2021-04-21 22:14:42

How to populate treeview ( treenode ) with data from datatable?

I have a datatable filled with class instances. The table has columns called Name and Name_of_Cement. But there are duplicate elements in the Name column. For example:
Name | Name_of_Cement
_________________|_____________________
Portland | Whirlwind
Romancement | Taiga
Romancement | Own
Alucement | Kuron

Tell me how to fill treeview ( treenode ) that would look something like this, but taking into account the fact that the table can be supplemented with the same Name

Cement
| ___ Portland
| |___ Whirlwind
|
|__Romancement
| |___Taiga
| |
| |___ Own
|
|__Alumacement
| |___Kuron

It seems that he tried all the crutches and nothing helped. I would be grateful for the answer

PS Here all the indents get lost. Sorry

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2021-04-22
@moClay

https://www.codeproject.com/Tips/447349/Populate-T...
https://blogs.msmvps.com/deborahk/populating-a-tre...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question