Example #1
0
    }//缩略显示

    protected void Grid_MeasAppliance_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_MeasAppliance.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();
        if (BlInto_S_Search == true)
        {
            BindGrid_MeasAppliance(Condition);
        }
        else
        {
            BindGrid_MeasAppliance("");
        }
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= Grid_MeasAppliance.PageCount ? Grid_MeasAppliance.PageCount - 1 : newPageIndex;
        Grid_MeasAppliance.PageIndex = newPageIndex;
        Grid_MeasAppliance.DataBind();
    }//翻页
Example #2
0
 private void BindGrid_MeasAppliance(string Condition)
 {
     Grid_MeasAppliance.DataSource = measApplianceL.Select_MeasApplianceMan(Condition);
     Grid_MeasAppliance.DataBind();
 }//计量器具检验列表Grid_MeasAppliance