protected void gvContract_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { GridView header = (GridView)sender; GridViewRow gvr = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert); TableCell tCell = new TableCell(); tCell.Text = "Contract Management"; tCell.ColumnSpan = 14; tCell.HorizontalAlign = HorizontalAlign.Left; tCell.CssClass = "trWithBorder"; gvr.Cells.Add(tCell); // Add the Merged TableCell to the GridView Header Table tbl = gvContract.Controls[0] as Table; if (tbl != null) { tbl.Rows.AddAt(0, gvr); } } if (e.Row.RowType.Equals(DataControlRowType.DataRow)) { DataRowView objDRV = (DataRowView)e.Row.DataItem; HyperLink objHlink = (HyperLink)e.Row.FindControl("hlContract"); string strPagePath = ""; strPagePath = "http://localhost:1973/VRM_WebSite/app/vrm/ContractThreeGridView.aspx?ContractId=" + objDRV["ContractId"].ToString(); objHlink.NavigateUrl = strPagePath; objHlink.Target = "_self"; }
protected void Page_Load(object sender, EventArgs e) { //string strContractId = Request.QueryString["ContractId"].ToString(); //string cid = Convert.ToString(Request.QueryString["ContractId"]); //if (cid != null) //{ // Response.Write("Fetch Records on the basis of ContracID " + cid); //} if (!IsPostBack) { //Set the sortExpression ViewState[this.ToString() + "_SortExpression1"] = "Terms"; ViewState[this.ToString() + "_SortDirection1"] = "ASC"; //Set the sortExpression ViewState[this.ToString() + "_SortExpression2"] = "FileName"; ViewState[this.ToString() + "_SortDirection2"] = "ASC"; //Set the sortExpression ViewState[this.ToString() + "_SortExpression3"] = "Item"; ViewState[this.ToString() + "_SortDirection3"] = "ASC"; //populate the criticalterms datatable DataTable tmpdt = vrmdb.Get_CriticalTerms().Tables[0]; tmpdt.PrimaryKey = new DataColumn[] { tmpdt.Columns[0] }; ViewState[viewStateGVName] = tmpdt; //populate the uploadeddocuments datatable DataTable tmpdtt = vrmdb.Get_UploadedDocuments().Tables[0]; tmpdtt = new DataTable(); tmpdtt = vrmdb.Get_UploadedDocuments().Tables[0]; tmpdtt.PrimaryKey = new DataColumn[] { tmpdtt.Columns[0] }; ViewState[viewStateGVUDName] = tmpdtt; //populate the uploadeddocuments datatable DataTable tmpCdt = vrmdb.Get_Checklist().Tables[0]; tmpCdt = new DataTable(); tmpCdt = vrmdb.Get_Checklist().Tables[0]; tmpCdt.PrimaryKey = new DataColumn[] { tmpCdt.Columns[0] }; ViewState[viewStateGVCLName] = tmpCdt; BindGrid(); BindGrid1(); BindGrid2(); string strContractId = Request.QueryString["ContractId"].ToString(); //This is one is to get the contract id parmater } }
Line 83: BindGrid1(); Line 84: BindGrid2(); Line 85: string strContractId = Request.QueryString["ContractId"].ToString(); Line 86: Line 87: