1 DataTable dt = (DataTable)gridView1.GridControl.DataSource; 2 DataRow[] drr = dt.Select(gridView1.RowFilter); 3 foreach (DataRow dr in drr) 4 { 5 dr["SelectFlag"] = "1"; 6 } 7 gridView1.GridControl.DataSource = dt; 8 gridView1.GridControl.Show();
快速全选筛选之后的gridview值。
类似方法也可将datarow[]组装为新的datatable
时间: 2024-10-12 22:12:28