I have desgining gridview ,in which i have applied quicksearch function of jquery for filtering the gridview control and also i have applied sorting and paging.with normal searching, jquery function working properly but the problem is,whenever I use paging means whenever the gridview page_index is changed the function stopped his working. Is there any solution available for this problem or it could’t be done?
My quicksearch function is like that:-
<script type="text/javascript">
$(function () {
$('input#TextBox1').quicksearch('table#grid tbody tr');
});
</script>
amd my paging logic is like:-
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
BindData();
}
Try adding the following
ScriptManager.RegisterStartupScript(tableId, tableId.GetType(), "QuickSearch", "$('input#TextBox1').quicksearch('table#grid tbody tr');", true);
to “GridView1_PageIndexChanging” (assuming you’re using a scriptmanager).