C#模糊查询绑定datagridview_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > C#模糊查询绑定datagridview

C#模糊查询绑定datagridview

 2014/5/28 12:01:16  奮鬥的QB  博客园  我要评论(0)
  • 摘要:privateCollectionViewSourcewgdData=newCollectionViewSource();privateDataTableDs_wgd{get{returnthis.dgv_wgd.ItemsSourceasDataTable;}set{wgdData.Source=value;this.dgv_wgd.ItemsSource=((DataTable)wgdData.Source).DefaultView;}}//文本框修改后
  • 标签:C# view tag 模糊查询

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() + "%' ";
}

发表评论
用户名: 匿名