C#模糊查询绑定datagridview
2020-12-13 02:06
标签:datagridview c tar a ext get private CollectionViewSource wgdData = new CollectionViewSource(); private DataTable Ds_wgd //文本框修改后,直接会修改 private void txt_jkshm_TextChanged(object sender, TextChangedEventArgs e) C#模糊查询绑定datagridview,搜素材,soscw.com C#模糊查询绑定datagridview 标签:datagridview c tar a ext get 原文地址:http://www.cnblogs.com/JohnnyBao/p/3756634.html
{
get { return
this.dgv_wgd.ItemsSource as DataTable; }
set
{
wgdData.Source = value;
this.dgv_wgd.ItemsSource = ((DataTable)wgdData.Source).DefaultView;
}
}
{
(this.wgdData.Source as DataTable).DefaultView.RowFilter
= "jkshm like ‘%" + this.txt_jkshm.Text.Trim() + "%‘ ";
}