Код: Выделить всё
DataTable table = new DataTable();
//DataTable is filled with values here...
DataGridView grid = new DataGridView();
foreach (DataColumn column in table.Columns)
{
grid.Columns.Add(column.ColumnName, column.ColumnName);
}
grid.DataSource = table;
Напротив, если я создаю DataGridView в winform, а затем назначаю его DataSource в DataTable, DataGridView.Rows будет добавлен автоматически.
Какой код мне здесь не хватает, чтобы правильно ли указано значение DataGridView.Rows?
Подробнее здесь: https://stackoverflow.com/questions/201 ... -datatable
Мобильная версия