private void LoadData(int page) { int recordNum = 0; int pageSize = Variable.DefaultPageSize; string retValue = string.Empty; GridView1.DataSource = BatchPlan.QueryBatchPlanList(QueryCondition(), pageSize, page, out recordNum); GridView1.DataBind(); lblRecordNum.Text = recordNum.ToString(); lblPresentPageNum.Text = page.ToString(); lblTotalPageNum.Text = (Math.Ceiling(Convert.ToDouble(recordNum) / pageSize)).ToString(); WSDataLayer.EnablePageControl(lbtFirstPage, lbtPreviousPage, lbtNextPage, lbtLastPage, recordNum, pageSize, Convert.ToInt32(lblTotalPageNum.Text), page); }
protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow gRow = (GridViewRow)((Control)e.CommandSource).Parent.Parent; string id = GridView1.DataKeys[gRow.RowIndex].Value.ToString(); if (e.CommandName == "ViewDetail") { DetailsView1.DataSource = BatchPlan.QueryMovePlanById(int.Parse(id)); DetailsView1.DataBind(); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "open", "Open()", true); } else if (e.CommandName == "ViewRelation") { Label lblMBID = (Label)GridView1.Rows[gRow.RowIndex].FindControl("lblMBID"); ViewState["MBID"] = lblMBID.Text; LoadData(1); } }