Example #1
0
    //Gridview翻页
    protected void Grid_CDDep_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_CDDep.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;
        }
        string condition = GetCondition2();

        BindGrid_CDDep(condition);
        newPageIndex         = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex         = newPageIndex >= Grid_CDDep.PageCount ? Grid_CDDep.PageCount - 1 : newPageIndex;
        Grid_CDDep.PageIndex = newPageIndex;
        Grid_CDDep.DataBind();
    }
Example #2
0
 //岗位分发代码列表Grid_CDDep
 private void BindGrid_CDDep(string condition)
 {
     Grid_CDDep.DataSource = basicCodeL.Search_CDDepDistributeCodeT(condition);
     Grid_CDDep.DataBind();
 }