M
M
Michael2020-11-18 11:00:12
WPF
Michael, 2020-11-18 11:00:12

Need advice on implementing a DataGrid structure?

Hello. There is such a task, something like a directory. We hammer in the name of the device, company, model, serial number. But the device may have some other devices included in the kit (for example, a monoblock has a keyboard and a mouse) I can’t figure out how to add components to the device, how to connect it all? I am writing an application in C#WPF using the MVVM pattern, the problem is that I don't understand how I can bind to a table.


In theory, I understand how to do this, I thought to create two lists, more precisely one list List<parant_name>for parents and one dictionary Dictionary<parent_id, List<child>>. If I click on the add device button, then an entry occurs in the List; if I click on the button to add a component to the device, then the current parent id is taken and written to the Dictionary, but how can I display all this in the DataGrid? I don't understand how to implement it

5fb4d1884dd47485060634.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question