protected void grdChangeRequirement_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow row = (GridViewRow)(((Control)e.CommandSource).NamingContainer); Label myTextBox = row.FindControl("lbl_SignOff") as Label; if (myTextBox.ToString() == "Yes") { Label btnUpdate = row.FindControl("btn_Update") as Label; Label btnCancel = row.FindControl("btn_Cancel") as Label; btnUpdate.Visible = false; btnCancel.Visible = false; } }
protected void grdChangeRequirement_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label btnUpdate = (e.Row.FindControl("btn_Update") as Label); Label btnCancel = (e.Row.FindControl("btn_Cancel") as Label); if (e.Row.Cells[12].Text == "Yes") { btnUpdate.Enabled = false; } } }
protected void grdChangeRequirement_RowDataBound(object sender, GridViewRowEventArgs e) { //Code to get the textbox value [To Do] //Check the valeu if (myTextBox.ToString() == "Yes") { // Code to disable the edit.. } }
protected void grdChangeRequirement_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { GridViewRow row = e.Row; Label lbl_SignOff = row.FindControl("lbl_SignOff") as Label; Label btnUpdate = row.FindControl("btn_Update") as Label; Label btnCancel = row.FindControl("btn_Cancel") as Label; if (lbl_SignOff.Text == "Yes") { btnUpdate.Visible = false; btnCancel.Visible = false; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)