Touhidul
Touhidul

Reputation: 1

Searching in C# Gridview

I have a grid view which display all of my saved data. When I click on date search button, data bind in grid view of particular date that I typed in text box. But when I try to go next page by clicking grid view pager button, grid view date bind all page of saved date. It's not binding data of that particular date. Please help me...

Upvotes: 0

Views: 464

Answers (1)

Damith
Damith

Reputation: 63065

you can implement PageIndexChanging as below.

protected void GridViewExtUsers1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{

    // Set the index of the new display page. 
    GridView1.PageIndex = e.NewPageIndex;

    // Rebind the GridView control 
    // if on search mode bind search results 
    // otherwise bind all data. 
    // implement your logic in different method
    BindGridView();
}

Upvotes: 2

Related Questions