Код: Выделить всё
class Data
{
IList ColumnDescriptions { get; set; }
string[][] Rows { get; set; }
}
Код: Выделить всё
for (int i = 0; i < data.ColumnDescriptions.Count; i++)
{
dataGrid.Columns.Add(new DataGridTextColumn
{
Header = data.ColumnDescriptions[i].Name,
Binding = new Binding(string.Format("[{0}]", i))
});
}
Подробнее здесь: https://stackoverflow.com/questions/320 ... of-columns