日期:2009-08-12 浏览次数:20950 次
private void grdProjTrace_SortCommand(object source, DataGridSortCommandEventArgs e) { this.grdProjTrace.CurrentPageIndex = 0; DataView dv = 得到数据代码; string strSort = ""; string strOrder ="";//排序方式。0,降序,1升序 if(ViewState["SortExpresstion"] != null) { strSort = ViewState["SortExpresstion"].ToString(); strSort = strSort.Substring(0,strSort.Length -1); strOrder = ViewState["SortExpresstion"].ToString(); strOrder = strOrder.Substring(strOrder.Length -1); } if(e.SortExpression == "CustomerName") { if(strSort != "CustomerName") { this.ViewState["SortExpresstion"] = ustomerName0"; dv.Sort = "CustomerName DESC"; } else { if(strOrder == "0") { this.ViewState["SortExpresstion"] = "CustomerName1"; dv.Sort = "CustomerName ASC"; } else { this.ViewState["SortExpresstion"] = "CustomerName0"; dv.Sort = "CustomerName DESC"; } } } if(e.SortExpression == "fullName") { if(strSort != "fullName") { this.ViewState["SortExpresstion"] = "fullName0"; dv.Sort = "fullName DESC"; } else { if(strOrder == "0") { this.ViewState["SortExpresstion"] = "fullName1"; dv.Sort = "fullName ASC"; } else { this.ViewState["SortExpresstion"] = "fullName0"; dv.Sort = "fullName DESC"; } } } this.grdProjTrace.DataSource = dv; this.grdProjTrace.DataBind(); } |
private void ChangePageDataBind() { DataView dv = 得到数据代码; string strSort = ""; string strOrder ="";//排序方式。0,降序,1升序 if(ViewState["SortExpresstion"] != null) { strSort = ViewState["SortExpresstion"].ToString(); strSort = strSort.Substring(0,strSort.Length -1); strOrder = ViewState["SortExpresstion"].ToString(); strOrder = strOrder.Substring(strOrder.Length -1); } if(this.ViewState["SortExpresstion"] != null) { if(strSort == "CustomerName") { if(strOrder == "1") { this.ViewState["SortExpresstion"] = "CustomerName1"; dv.Sort = "CustomerName ASC"; } else { this.ViewState["SortExpresstion"] = "CustomerName0"; dv.Sort = "CustomerName DESC"; } } } if(this.ViewState["SortExpresstion"] != null) { if(strSort == "fullName") { if(strOrder == "1") { this.ViewState["SortExpresstion"] = "fullName1"; dv.Sort = "fullName ASC"; } else { this.ViewState["SortExpresstion"] = "fullName0"; dv.Sort = "fullName DESC"; } } } this.grdProjTrace.DataSource = dv; this.grdProjTrace.DataBind(); } |
private void grdProjTrace_PageIndexChanged(object source, DataGridPageChangedEventArgs e) { try { try { this.grdProjTrace.CurrentPageIndex = e.NewPageI
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|