在DataGireView中加筛选条件

dt (查询出的数据源)

BindingSource source = new BindingSource();
source.DataSource = dt;
foreach (DataGridViewColumn col in dgvGoodImport.Columns)
{
       col.HeaderCell = new DataGridViewAutoFilterColumnHeaderCell(col.HeaderCell);
}
this.dgvGoodImport.DataSource = source;

posted on 2012-03-27 21:46  零下273度  阅读(301)  评论(0编辑  收藏  举报

导航