如何将WPF DataGrid绑定到可变列数?
class Data{ IList<ColumnDescription> 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)) });}
PIPIONE
相关分类