Esempio n. 1
0
    //Gridview翻页
    protected void Grid_EquipUpkeepItem_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_EquipUpkeepItem.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;
        }
        string condition = GetCondition();

        BindGrid_EquipUpkeepItem(condition);
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= Grid_EquipUpkeepItem.PageCount ? Grid_EquipUpkeepItem.PageCount - 1 : newPageIndex;
        Grid_EquipUpkeepItem.PageIndex = newPageIndex;
        Grid_EquipUpkeepItem.DataBind();
    }
Esempio n. 2
0
 //绑定设备保养项目gridview
 private void BindGrid_EquipUpkeepItem(string condition)
 {
     Grid_EquipUpkeepItem.DataSource = equipUpkeepItemL.Search_EquipUpkeepItemInfo(condition);
     Grid_EquipUpkeepItem.DataBind();
 }