protected void grdComments_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Page.Validate("commentsDataEdit");
            if (Page.IsValid)
            {
                int workId = (int)e.Keys["WorkID"];
                int refId = (int)e.Keys["RefID"];
                int companyId = Int32.Parse(hdfCompanyId.Value);
                int loginId = Convert.ToInt32(Session["loginID"]);
                bool adminPermission = Convert.ToBoolean(Session["sgLFS_CWP_FULLLENGTHLINING_ADMIN"]);
                bool toHistory = false;

                string newSubject = ((TextBox)grdComments.Rows[e.RowIndex].Cells[3].FindControl("tbxSubjectEdit")).Text.Trim();
                string newComment = ((TextBox)grdComments.Rows[e.RowIndex].Cells[4].FindControl("tbxCommentsEdit")).Text.Trim();
                string newType = "";
                if (((DropDownList)grdComments.Rows[e.RowIndex].Cells[3].FindControl("ddlTypeEdit")).Visible)
                {
                    newType = ((DropDownList)grdComments.Rows[e.RowIndex].Cells[3].FindControl("ddlTypeEdit")).SelectedValue.ToString().Trim();
                }
                else
                {
                    newType = ((TextBox)grdComments.Rows[e.RowIndex].Cells[3].FindControl("tbxTypeEdit")).Text;
                }

                // Update data
                FullLengthLiningWetOutCommentsDetails model = new FullLengthLiningWetOutCommentsDetails(fullLengthLiningTDS);
                model.Update(workId, refId, newType, newSubject, companyId, newComment, loginId, adminPermission, toHistory);

                // Store dataset
                Session["fullLengthLiningTDS"] = fullLengthLiningTDS;
                Session["fullLengthLiningWetOutCommentDetails"] = fullLengthLiningTDS.WetOutCommentsDetails;
            }
            else
            {
                e.Cancel = true;
            }
        }