MYYA
DefaultView 属性返回可用于排序、筛选和搜索 DataTable 的 DataView。可通过 DefaultView 属性设置 DataTable 对象的 DataView 的属性。如下示例:示例还演示了 DataGridView 控件如何绑定到一个名为“Suppliers”、含有一个名为“CompanyName”的列的 DataTable。private void BindDataGrid(){DataTable table = new DataTable();// Insert code to populate a DataTable with data.// Bind grid to DataTable.dataGrid1.DataSource = table;}private void ChangeRowFilter(){DataTable gridTable = (DataTable) dataGrid1.DataSource;// Set the RowFilter to display a company names that// begin with A through I..gridTable.DefaultView.RowFilter = "CompanyName < 'I'";}