Example #1
0
    }//翻页

    protected void Grid_History_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_History.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;
        }
        //Grid_Post.DataBind();
        BindGrid_History(ID_His);
        newPageIndex           = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex           = newPageIndex >= Grid_History.PageCount ? Grid_History.PageCount - 1 : newPageIndex;
        Grid_History.PageIndex = newPageIndex;
        Grid_History.DataBind();
    }//翻页
Example #2
0
    }//计量器具检验列表Grid_MeasAppliance

    private void BindGrid_History(Guid id)
    {
        Grid_History.DataSource = measApplianceL.Select_MeasApplianceDetail(id);
        Grid_History.DataBind();
    }//计量器具检验列表Grid_MeasAppliance