Exemplo n.º 1
0
    protected void Gridview_Detail_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_DetailPlan.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;
        }


        BindDetail();
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= Gridview_DetailPlan.PageCount ? Gridview_DetailPlan.PageCount - 1 : newPageIndex;
        Gridview_DetailPlan.PageIndex = newPageIndex;
        Gridview_DetailPlan.DataBind();
    }
Exemplo n.º 2
0
    protected void BindDetail()
    {
        Guid id = new Guid(label53.Text.ToString());

        Gridview_DetailPlan.DataSource = pp.Select_PlanDetail(id);
        Gridview_DetailPlan.DataBind();
        UpdatePanel_Detail.Update();
    }