Пример #1
0
    protected void Gridview_Pur_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        = Gridview_Pur.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;
        }

        BindMat();
        newPageIndex           = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex           = newPageIndex >= Gridview_Pur.PageCount ? Gridview_Pur.PageCount - 1 : newPageIndex;
        Gridview_Pur.PageIndex = newPageIndex;
        Gridview_Pur.DataBind();
    }
Пример #2
0
 //绑定库存表
 protected void BindPur()
 {
     GetCondition_Kucun();
     Gridview_Pur.DataSource = db.Select_IMIM_Pubian(label38.Text.ToString().Trim());
     Gridview_Pur.DataBind();
     UpdatePanel1.Update();
 }
Пример #3
0
 protected void BindMat()
 {
     Gridview_Pur.DataSource = dp.SelectKucunMain(label38.Text.ToString());
     Gridview_Pur.DataBind();
     UpdatePanel2.Update();
 }