I want to create grid in WPF, which is dynamiccally grows depending on the array length that is in the view model. So in view model I have three props:
public string[] HorisontalNames {get;}
public string[] VerticalNames {get;}
public double[,] Values {get;set;}
Is that possible? I want it to be simple for view model.
You would need to remodel your data a bit in your view model, and you can use a solution such as the one provided by Meleak at https://stackoverflow.com/a/4379965/248164.
This attached property will let you bind your
DataGridcolumns to a collection ofDataGridColumnon your view model. These will be your horizontal names.The vertical names will be the values of the first column.