I create application, where user creates alternatives and criteria. My alternative should have list of criteria, so user can give value for particular criteria in alternative. I would like to present this as a matrix, where rows are alternatives and columns are criteria. User during runtime can create new alternatives and criteria. Both are created using dialogbox, additionally presented in ListView
. I store them in ObservableCollection
.
My problem is, that DataGrid
control doesn't offer easy way to add columns. I look for a solution to my problem, where I could create during runtime both columns and rows. Maybe DataGrid
is wrong control to use in this scenario. I found some solution, but it doesn't feel right to me. All data, that user inserts, will be later used in solver. Maybe DataTable
is way to go?
example: https://svitla.com/blog/grid-with-dynamic-number-of-rows-and-columns-part-1