I'm trying to create a datagrid with a variable number of columns and rows. I can create the columns but I don't know how to insert the content.
_dataGrid.Columns.Add(new DataGridTextColumn { Header = "Column 0",
Binding = new Binding("0")
}
);
I have all of the data that I want to add in a string[,]. I don't understand how to prepare a data structure that implements IEnumerable so that I can set
_dataGrid.ItemsSource = GenerateData();//I'd expect to return a Dictionary["0"]=List<string>(){"1","2","3"} to bind to but it doesn't work
What is the data structure that I need to return from GenerateData if I wanted to include a column that had "1", "2", "3"?
Thanks in advance.