码迷,mamicode.com
首页 > Windows程序 > 详细

C#模糊查询绑定datagridview

时间:2014-05-29 11:05:47      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:datagridview   c   tar   a   ext   get   

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

标签:datagridview   c   tar   a   ext   get   

原文地址:http://www.cnblogs.com/JohnnyBao/p/3756634.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!