public void BindData() { String condition = ViewState["condition"] + ""; Int32 count = 0; if (String.IsNullOrEmpty(condition)) { count = XUser.Meta.Count; } else { count = XUser.FindCount(condition, null, null, 0, 0); } this.DataGrid1.AllowCustomPaging = true; this.DataGrid1.VirtualItemCount = count; this.DataGrid1.DataSource = this.buildGridData(); this.DataGrid1.DataBind(); }