C#模糊查询绑定datagridview

private CollectionViewSource wgdData = new CollectionViewSource();

private DataTable Ds_wgd
{
get { return this.dgv_wgd.ItemsSource as DataTable; }
set
{
wgdData.Source = value;
this.dgv_wgd.ItemsSource = ((DataTable)wgdData.Source).DefaultView;
}
}

//文本框修改后,直接会修改

private void txt_jkshm_TextChanged(object sender, TextChangedEventArgs e)
{
(this.wgdData.Source as DataTable).DefaultView.RowFilter = "jkshm like ‘%" + this.txt_jkshm.Text.Trim() + "%‘ ";
}

C#模糊查询绑定datagridview,布布扣,bubuko.com

C#模糊查询绑定datagridview

上一篇:C# 使用摄像头拍照 支持Win7 64位


下一篇:02.08 Longest Regular Bracket Sequence