在asp.net C#中搜索gridview [英] searching gridview in asp.net C#

查看:78
本文介绍了在asp.net C#中搜索gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试寻找一种使用C#编程语言在asp.net中搜索网格视图的方法.我不希望网格视图启用分页.我希望它显示输入的结果.如果我输入"s",则仅显示以s开头的所有记录.

I am trying to look for a way to search a grid view in asp.net using C# programming language. I dont want the grid view to have paging enabled. I would like it to bring up the result of the input typed in. E.g. If i typed in 's', all records starting with s would only be visible.

我查找了一些在代码中具有数据绑定的站点.

I have looked up on some sites which have databind in the code.

GridView1.DataSource = dt;
GridView1.DataBind();

我需要这个吗?这是做什么的?

Do I need to have this? What does this do?

我可以在建议或链接方面获得一些帮助,这些问题可以解答我的问题.谢谢你.

Can I please get some help with advice or links that can answer my question. Thank you.

推荐答案

您可以使用"DataTable" JavaScript功能解决此问题.请参考 https://www.datatables.net/.

You can use "DataTable" javascript functionality for this problem. Please refer https://www.datatables.net/.

$(document).ready(function(){
    $('#GridView1').DataTable();
});

仅在此处设置表格ID,它将自动设置表格的分页,排序和过滤.

only set your table id here and it will automatically set pagination, sorting, filtering of your table.

谢谢

这篇关于在asp.net C#中搜索gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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