You can replace my name "Venkat" with your text

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')");
}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top