如何在输入时使用文本框在gridview中搜索记录 [英] how to use text box for searching record in gridview while typing

查看:86
本文介绍了如何在输入时使用文本框在gridview中搜索记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想在不使用按钮的情况下在文本框中输入时在gridview中搜索记录。

我在更新面板中使用更新面板我把gridview和搜索文本框放在一起。



我已经使用数据集将我的gridview绑定为

Hallo,
I would like to search record in gridview while typing in a textbox without using a button.
I am using update panel, inside the update panel i put the gridview as well as the search textbox.

I have already bind my gridview using dataset as

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {            
            updateGrid();            
        }
        
    }
private void updateGrid()
    {
        try
        {
            DataSet ds = stu.GetStudent();
            if (ds.Tables[0].Rows.Count > 0)
            {
                grv_Student.DataSource = ds;
                grv_Student.DataBind();
            }
            else
            {
                grv_Student.DataSource = null;
                grv_Student.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }

推荐答案

您可以在以下链接找到解决方案:

http://www.ashishblog.com/search-sort-in-gridview-using-c-net- ajax-and-jquery / [ ^ ]
You can find the solution at this link:
http://www.ashishblog.com/search-sort-in-gridview-using-c-net-ajax-and-jquery/[^]


这篇关于如何在输入时使用文本框在gridview中搜索记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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