在数据网格视图中搜索 [英] Search in Data Grid View

查看:84
本文介绍了在数据网格视图中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个C#GUI形式的DataGrid视图,我有一个文本框和一个按钮点击按钮我想在gridview上搜索我有什么在文本框中,它通过以下代码工作:



Hi

I have a DataGrid view in c# GUI form and i have one text box and one button on button click i want to search on gridview what i have right in text box its working by this code:

for (int i = 0; i < dataGridView1.Rows.Count; i++)
           {
               if (!dataGridView1.Rows[i].IsNewRow)
               {
                   if ((dataGridView1[0, i].Value.ToString().Contains(textBox1.Text)))
                       dataGridView1.Rows[i].Selected = true;
}



现在我想要的不是带有文本框值的马赫...... ??



请帮我解决这个问题.....


Now i want which is not mach with text box value ...??

Please help me regarding this.....

推荐答案

嗨!!看看这个必须帮助你的链接。

http://www.aspdotnet-suresh.com/2011/12/search-records-in-gridview-and.html [ ^ ]
Hi!! Take a look of this link this must help you.
http://www.aspdotnet-suresh.com/2011/12/search-records-in-gridview-and.html[^]


这篇关于在数据网格视图中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆