public object SetCurrentView(IEnumerable<IFreeDocument> datas) { if (!datas.Any()) { return null; // throw new Exception("不存在任何数据"); ; } var listview = new DataGridViewUI(); foreach (var data in datas.GetKeys()) { listview.DataGridControl.Columns.Add(new Column { Title = data, FieldName = $"[{data}]"}); } listview.DataContext = datas; return listview; }
public object SetCurrentView(IEnumerable <IFreeDocument> datas) { if (!datas.Any()) { return(null); // throw new Exception("不存在任何数据"); ; } var listview = new DataGridViewUI(); foreach (var data in datas.GetKeys()) { listview.DataGridControl.Columns.Add(new Column { Title = data, FieldName = string.Format("[{0}]", data) }); } listview.DataContext = datas; return(listview); }