2015-01-05 21 views
0

我有一個網格聲明綁定到SQL數據源。然後過濾這個網格並顯示過濾結果。我還有一個標籤,顯示一條消息,比如「17個帶有當前過濾器的記錄」。如何計算RadGrid中的記錄? (客戶端,AJAX)

什麼radgrid控件的事件我會處理更新我的標籤與radgrid控件中顯示的記錄數的最高最新的計數顯示此消息?一個

我的網格使用Ajax更新基於記錄在過濾器上。

回答

1

嗨,

 bool check = false; 
     protected void RadGrid1_PreRender(object sender, EventArgs e) 
     { 
      if (check) 
      { 
       RadGrid1.AllowPaging = false; 
       RadGrid1.Rebind(); 
       Response.Write(RadGrid1.MasterTableView.Items.Count); 
       RadGrid1.AllowPaging = true; 
       RadGrid1.Rebind(); 
      } 
     } 
     protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
     { 
      if (e.CommandName == RadGrid.FilterCommandName) 
      { 
       check = true; 
      } 
      else 
      { 
       check = false; 
      } 
     } 

感謝,
薩里薩。