protected void gvApplications_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { bool CompletionStatus = false; Label lblSatus = (Label)e.Row.FindControl("lblStatus"); Label lblAppId = (Label)e.Row.FindControl("lblAppID"); String selectedQuarter = (ddlQuarter.SelectedIndex.Equals(0)) ? String.Empty : ddlQuarter.SelectedItem.Text.Trim(); Label lblControlOwner1 = (Label)e.Row.FindControl("lblControlOwner"); //lblSatus.Text = FetchApplicationStatus(role, selectedQuarter, Convert.ToInt32(lblAppId.Text)); clsBALApplication objclsBALApplication = new clsBALApplication(); clsEALUser objController = new clsEALUser(); //objController = objclsBALCommon.FetchUserDetailsFromAD(lblControlOwner1.Text.ToString()); clsBALCommon objclsBALCommon1 = new clsBALCommon(); DataSet dsCO = objclsBALCommon1.GetAppControlOwnerInfo(Convert.ToInt32(lblAppId.Text)); if (dsCO != null) { if (dsCO.Tables[0].Rows.Count > 0) { objController = objclsBALCommon1.FetchUserDetailsFromAD(dsCO.Tables[0].Rows[0][5].ToString()); if (objController != null) { if (role.Contains <string>(clsEALRoles.ComplianceAdmin)) { CompletionStatus = objclsBALApplication.GetApplicationCompletionStatus(clsEALRoles.ComplianceAdmin, objController, selectedQuarter, Convert.ToInt32(lblAppId.Text)); } else { CompletionStatus = objclsBALApplication.GetApplicationCompletionStatus(clsEALRoles.ControlOwner, objController, selectedQuarter, Convert.ToInt32(lblAppId.Text)); } } if (CompletionStatus) { lblSatus.Text = "Completed"; } else { lblSatus.Text = "Pending"; } } } if (lblSatus.Text == "Status") { lblSatus.Text = "Pending"; } } }