protected void gvCourses_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton btnEdit = (ImageButton)e.Row.FindControl("btnEdit");
if (btnEdit != null)
{
btnEdit.PostBackUrl = "EditCourse.aspx?Tab=1&CourseId=" + gvCourses.DataKeys[e.Row.RowIndex].Values["CourseId"].ToString();
}
ImageButton btnDelete = (ImageButton)e.Row.FindControl("btnDelete");
if (btnDelete != null)
{
string IsAssinged = gvCourses.DataKeys[e.Row.RowIndex].Values["IsCourseAssignedtoaUser"].ToString();
string DoesCourseHasRequest = gvCourses.DataKeys[e.Row.RowIndex].Values["CourseHasRequests"].ToString();
if (IsAssinged == "1")
{
btnDelete.Enabled = false;
btnDelete.ToolTip = Constants.MSG_Course_Assignedorexamcreated;
btnDelete.ImageUrl = "~/Images/btnRomoveDisable.gif";
}
else
{
btnDelete.Enabled = true;
btnDelete.Attributes.Add("onclick", "return ConfirmCourseDelete('" + DoesCourseHasRequest + "');");
}
}
}
}
catch (Exception ex)
{
}
}
Tuesday, August 26, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment