V
venkat r
protected void gvReferences_RowDataBound(object sender, GridViewRowEventArgs e)
{
bool isReadOnly = false;
LinkButton lb = null;
if (e.Row.RowType == DataControlRowType.DataRow)
{
P.Application app = this.GetApplication(false);
isReadOnly = (app.CurrentStatus().Type != P.ApplicationStatus.Types.Open);
foreach (TableCell tc in e.Row.Cells)
{
if ( ( tc.Controls.Count > 0 ) && tc.Controls[0] is LinkButton )
{
lb = tc.Controls[0] as LinkButton;
if ( lb != null && lb.Text.Equals("View", StringComparison.InvariantCultureIgnoreCase) )
lb.Visible = isReadOnly;
if (lb != null && lb.Text.Equals("Edit", StringComparison.InvariantCultureIgnoreCase))
{
lb.Visible = (!isReadOnly);
lb.Text = "Venkat";
}
if ( lb != null && lb.Text.Equals("Delete", StringComparison.InvariantCultureIgnoreCase) )
lb.Visible = (!isReadOnly);
}
}
//Add delete confirmation message for Question
LinkButton l = (LinkButton)e.Row.FindControl("linkDelete");
l.Attributes.Add("onclick", "javascript:return " +
"confirm('Are you sure you want to delete this Reference')");
}
}
{
bool isReadOnly = false;
LinkButton lb = null;
if (e.Row.RowType == DataControlRowType.DataRow)
{
P.Application app = this.GetApplication(false);
isReadOnly = (app.CurrentStatus().Type != P.ApplicationStatus.Types.Open);
foreach (TableCell tc in e.Row.Cells)
{
if ( ( tc.Controls.Count > 0 ) && tc.Controls[0] is LinkButton )
{
lb = tc.Controls[0] as LinkButton;
if ( lb != null && lb.Text.Equals("View", StringComparison.InvariantCultureIgnoreCase) )
lb.Visible = isReadOnly;
if (lb != null && lb.Text.Equals("Edit", StringComparison.InvariantCultureIgnoreCase))
{
lb.Visible = (!isReadOnly);
lb.Text = "Venkat";
}
if ( lb != null && lb.Text.Equals("Delete", StringComparison.InvariantCultureIgnoreCase) )
lb.Visible = (!isReadOnly);
}
}
//Add delete confirmation message for Question
LinkButton l = (LinkButton)e.Row.FindControl("linkDelete");
l.Attributes.Add("onclick", "javascript:return " +
"confirm('Are you sure you want to delete this Reference')");
}
}