简体   繁体   中英

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...

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();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM