2012-04-29 37 views
0

我有一個網格視圖,顯示我保存的所有數據。當我點擊日期搜索按鈕時,數據綁定在我在文本框中輸入的特定日期的網格視圖中。但是,當我嘗試通過單擊網格視圖尋呼機按鈕去下一頁時,網格視圖日期綁定保存日期的所有頁面。它不是那個特定日期的有約束力的數據。請幫助我...在C#中進行搜索Gridview

回答

2

你可以實施PageIndexChanging如下。

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