Пример #1
0
    protected void GridView_Teacher_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_Teacher.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox2");   // 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 (Label9.Text == "检索前")
        {
            BindGridView_Teacher("");
        }
        if (Label9.Text == "检索后")
        {
            BindGridView_Teacher(Condition3);
        }
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= GridView_Teacher.PageCount ? GridView_Teacher.PageCount - 1 : newPageIndex;
        GridView_Teacher.PageIndex = newPageIndex;
        GridView_Teacher.DataBind();
    }
Пример #2
0
    }//GridViewAdd进行翻页

    #endregion



    #region//考核人和审核人选择栏

    private void BindGridView_Teacher(string Condition)
    {
        GridView_Teacher.DataSource = neiaL.Search_ForTeacher_HRDDetail(Condition);
        GridView_Teacher.DataBind();
    }//考核人和审核人列表GridView_Teacher