用文本框排序 [英] Sorting with textbox
本文介绍了用文本框排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用此代码过滤datagridview,但不起作用
i m trying to filter datagridview with this code but does not work
productsBindingSource1.Filter = String.Format("ProductName LIKE ''{0}%'' OR Barcode = ''{0}'' OR Comment LIKE ''%{0}%''", txtSearch.Text);
datagridview源是productsBindingSource1
datagridview source is productsBindingSource1
Can enyone tell why this does not work?
推荐答案
签出属性BindingSource.SupportsFiltering
和BindingSource.SupportsAdvancedSorting
.
数据源根本不支持高级过滤(多列过滤)或根本不支持任何过滤也就不足为奇了.
请查看DataSource成员以获取更多信息:
http://msdn.microsoft.com/en-us/library/ms158196%28v = VS.80%29.aspx [ ^ ]
祝你好运!
Check out the propertyBindingSource.SupportsFiltering
andBindingSource.SupportsAdvancedSorting
.
It would be no surprise that the data source simply doesn''t support advanced filtering (multi-column filtering) or any filtering at all.
Have a look at the DataSource members for more info:
http://msdn.microsoft.com/en-us/library/ms158196%28v=VS.80%29.aspx[^]
Good luck!
莱斯特,
尝试以下链接,它将对您有所帮助.
DataGridView中的数据过滤器 [
Hi Lester,
Try the following link its will helpful to you.
Data Filter in DataGridView[^]
Cheers :)
这篇关于用文本框排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文