protected void GVStaus_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "View") { Registration_BE objR = new Registration_BE(); dt = new DataTable(); GridViewRow gvrow = (GridViewRow)((Control)e.CommandSource).NamingContainer; // objR.DI_AO_Code = dicode; objR.dept = Department; objR.status = ((Label)(gvrow.FindControl("lblStatusId"))).Text; string Status = ((Label)(gvrow.FindControl("lblStatusName"))).Text; objR.Action = "SMPL"; dt = Objrdl.DashBoard(objR, con); if (dt.Rows.Count > 0) { GVSamples.DataSource = dt; GVSamples.DataBind(); SampleData.Visible = true; lblStatus.Text = Status; } } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } }
protected void BindGrid() { check(); objBE.Action = "R"; objBE.Dept = Session["Department"].ToString(); objBE.SampleTypeId = ddlSamtype.SelectedValue; dt = ObjDL.SampleIUDR(objBE, con); if (dt.Rows.Count > 0) { GVSamples.DataSource = dt; GVSamples.DataBind(); } else { GVSamples.DataSource = null; GVSamples.DataBind(); } }