Exemplo n.º 1
0
    protected void Grid_NewEquipSpare_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_NewEquipSpare.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;
        }
        CollectSelected();
        //BindGrid_NewEquipSpare("");
        string condition = GetCondition1();

        BindGrid_NewEquipSpare(condition);
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= Grid_NewEquipSpare.PageCount ? Grid_NewEquipSpare.PageCount - 1 : newPageIndex;
        Grid_NewEquipSpare.PageIndex = newPageIndex;
        Grid_NewEquipSpare.DataBind();
    }
Exemplo n.º 2
0
 //模糊查询,绑定备选备件表
 private void BindGrid_NewEquipSpare(string condition)
 {
     Grid_NewEquipSpare.DataSource = equipNameModelL.Search_EquipFreqUsedSpare_InsertInfo(condition);
     Grid_NewEquipSpare.DataBind();
 }