var table = new DataTable();
table.Columns.AddRange(new DataColumn[]
{
new DataColumn("test"), //和dawnGridView1的field字段对应
new DataColumn("test2"),
});
table.BeginLoadData();
for (int I = 0; I < 3; I++)
{
DataRow row = table.NewRow();
row[0] = "1212";
row[1] = "1212";
table.Rows.Add(row);
}
table.EndLoadData();
this.dawnGridView1.DataSource = table;
分组:
this.grdviewData.GroupDescriptors.Clear();
this.grdviewData.EnableSorting = true;
this.grdviewData.GroupDescriptors.Add("PLAN_TYPE", ListSortDirection.Ascending);
过滤:
FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = "ProductName";
filter.IsFilterEditor = true;
this.dawnGridView1.FilterDescriptors.Add(filter);