TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vineshkumar v
NA
305
429
Gridview bind, searching and pagination for jquery using asp.net
Mar 11 2021 9:50 AM
Gridview bind, searching and pagination for jquery using asp.net
Reply
Answers (
2
)
1
Sachin Singh
7
55.8k
83.6k
Mar 11 2021 2:44 PM
you don't need to implement paging, seraching and sorting explicitly just bind your gridview with database data and then apply $("#Gridview1").datatable(); script , this will convert the grid into jquery dataTable.
use jquery datatable, and bind GridView in code behind also set thead and tbody in RowDataBound event
<form id=
"form1"
runat=
"server"
>
<div>
<asp:GridView ID=
"GridView1"
runat=
"server"
OnRowDataBound=
"GridView1_RowDataBound"
></asp:GridView>
</div>
</form>
<script src=
"Script/Jquery.js"
></script>
<script type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"
></script>
<link type=
"text/css"
rel=
"stylesheet"
href=
"https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
/>
<script type=
"text/javascript"
>
$(document).ready(function () {
$(
'#<%= GridView1.ClientID %>'
).DataTable();
});
</script>
protected
void
Page_Load(object sender, EventArgs e)
{
BindGrid();
}
protected
void
GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if
(e.Row.RowType == DataControlRowType.Header)
{
//add the thead and tbody section programatically
e.Row.TableSection = TableRowSection.TableHeader;
}
}
visit this
https://www.c-sharpcorner.com/forums/implement-pagination-and-search-in-asp-net-gridview
1
Rijwan Ansari
4
65k
3m
Mar 11 2021 1:03 PM
Use JQuery datatable
https://datatables.net/
A project with an Output Type of Class Library cannot be started direc
Reading Data from excel