如何在按下文本框上绑定GridView [英] How to bind GridView on textbox keypressed
问题描述
hi @全部
当我在文本框中输入符号(onkeypress)时,我正在寻找一种解决方案来对GridView进行数据绑定.
整个过程应该像Google这样的搜索.
当我输入内容时,gridview应该使用文本框中的文本更新他的数据源,并显示已过滤"的数据记录.
我试图用javascript onkeypressed进行回发,但是随后我的文本框失去了文本和焦点.
我尝试的另一件事是从客户端调用服务器端函数,但是以这种方式,我无法绑定gridview.
您将如何解决我的问题?
是否可以从客户端通过sqldatasource对gridview进行数据绑定?
感谢您的帮助!
hi @ all
I''m searching for a solution to do a DataBind of my GridView when I entered a sign in my textbox (onkeypress).
The whole thing, should be a search like google.
When I enter something the gridview should updated his datasource with the text in the textbox and display the "filtered" datarecords.
I have tried to do a postback in javascript onkeypressd, but then my textbox looses the text and the focus.
An other thing i tried is to call a server-side function from client-side, but on this way i can''t bind the gridview.
How would you solve my problem?
Is there any possibility to databind gridview with the sqldatasource from client-side?
Thanks for your help!
推荐答案
您可以使用文本框的服务器端事件 TextChanged .
You can use Server Side event TextChanged of Textbox.
这篇关于如何在按下文本框上绑定GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!