搜索框按单词在datagridview中扔了列 [英] Search box threw column in datagridview by words

查看:99
本文介绍了搜索框按单词在datagridview中扔了列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我需要一些帮助,我知道我要问很多,但我有一个datagridview,其中装有绑定源,文本框和按钮.假设我在datagridview中有100行,其中有5列,其中一列用于过滤我提到的throw文本框.因此,当我在该文本框中输入文字时,然后单击按钮,它会过滤行.但是我想要在该文本框中键入该列单元格中存在的文本中的任何单词,然后再次过滤.类似于网络浏览器中的任何搜索框.我完全陷入困境,甚至都不知道如何启动代码,我尝试了一些尝试,但一无所获

感谢

Hello,

I need some help, and I know I ask to much, but I have a datagridview populated with binding source, a textbox and the button. let''s say I have 100 rows in datagridview with 5 column, and one column is for filtering threw textbox that I mentioned. so when I type in text in that textbox, then click on button it filteres rows . but what I want is to type in that textbox any word or words from the text that exists in the cells of that column, and it filteres again. something like any search box in web broser. I am totaly stuck, dont know how to even start the code, I tried some things but nothing

thanks

推荐答案

正如我从您的问题中意识到的那样,您已经有一个运行在ButtonClick事件上的过滤算法.因此,您可以使用相同的算法向TextBoxTextChanged事件中添加事件处理程序.
As I realized from your question, you already have a filtering algorithm that runs on a Button''s Click event. So, you can add an event-handler to the TextBox''s TextChanged event with the same algorithm.


这篇关于搜索框按单词在datagridview中扔了列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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