0

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

micnow21
  • 41
  • 1
  • 8
  • What type of control would be in "criteria", textbox, dropdown? Can users add their own values or just select predefined? – FCin Oct 04 '18 at 12:11
  • Simple textbox. Most probably only numbers. User can add their own values. – micnow21 Oct 04 '18 at 12:19
  • Possible duplicate of [How do I bind a WPF DataGrid to a variable number of columns?](https://stackoverflow.com/questions/320089/how-do-i-bind-a-wpf-datagrid-to-a-variable-number-of-columns) – ASh Oct 04 '18 at 12:21

0 Answers0