private void RefreshGrid() { DateTime dt = DateTime.Today; if (Request.QueryString["date"] != null) { try { dt = Convert.ToDateTime(Request.QueryString["date"]); } catch { } } ViewState["DATE"] = dt.ToShortDateString(); string UserID = Session["UserID"].ToString(); DataView dvArrange = new ArrangeOther().SelectFromUnder(UserID, dt); this.dgArrange.DataSource = dvArrange; this.dgArrange.DataBind(); //调用一个js函数,用于强制执行datagrid的颜色变换。如不用,因updatapanel中数据更新后将无法引起datagridcolor.js的执行 CallJsFun("ChangeColor();"); UpdatePanel1.Update(); }
private void RefreshGrid() { DateTime dt = DateTime.Today; if (Request.QueryString["date"] != null) { try { dt = Convert.ToDateTime(Request.QueryString["date"]); } catch { } } ViewState["DATE"] = dt.ToShortDateString(); string UserName = this.txtUserName.Text.Trim(); string HeadName = this.txtHeadName.Text.Trim(); int TotalNum = 0; DataView dvArrange = new ArrangeOther().SelectFromUnderOther(UserName, HeadName, dt, Pager1.PageSize, Pager1.CurrentPageIndex, out TotalNum); this.dgArrange.DataSource = dvArrange; this.dgArrange.DataBind(); //调用一个js函数,用于强制执行datagrid的颜色变换。如不用,因updatapanel中数据更新后将无法引起datagridcolor.js的执行 CallJsFun("ChangeColor();"); UpdatePanel1.Update(); }