//翻页 protected void Grid_Item_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView theGrid = sender as GridView; // refer to the GridView int newPageIndex = 0; if (-2 == e.NewPageIndex) { TextBox txtNewPageIndex = null; GridViewRow pagerRow = Grid_Item.BottomPagerRow; if (null != pagerRow) { txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox"); // refer to the TextBox with the NewPageIndex value } if (null != txtNewPageIndex && txtNewPageIndex.Text != "") { newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex } } else { newPageIndex = e.NewPageIndex; } if (LblSearchCond.Text == "ItemAll") { BindGridMItem(idM); } else if (LblSearchCond.Text == "ItemCond") { BindGridMItemF(idM, BindcN, BindcB); } else if (LblSearchCond.Text == "Rest") { BindGridIAll(idM, BindcN, BindcB); } newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; newPageIndex = newPageIndex >= Grid_Item.PageCount ? Grid_Item.PageCount - 1 : newPageIndex; Grid_Item.PageIndex = newPageIndex; Grid_Item.DataBind(); }
//绑定模糊检索某物料的管制项目Gridview private void BindGridMItemF(Guid ID, string cond1, string cond2) { Grid_Item.DataSource = hSFBasicDataL.Search_HSFContrItems_FM(ID, cond1, cond2); Grid_Item.DataBind(); }
//绑定某物料的管制项目Gridview private void BindGridMItem(Guid ID) { Grid_Item.DataSource = hSFBasicDataL.Search_HSFContrItems_M(ID); Grid_Item.DataBind(); }
//绑定模糊检索其他管制项目Gridview private void BindGridIAll(Guid id, string HSFCI_ItemName, string HSFCI_Boundary) { Grid_Item.DataSource = hSFBasicDataL.Search_HSFContrItems_Rest(id, HSFCI_ItemName, HSFCI_Boundary); Grid_Item.DataBind(); }