views:

259

answers:

1

I am using Asp.Net Dynamic Data. I want to remove delete button from List and details page. I dont want to remove it from mark up. Is there any way to remove delete button based on entity and without adding custom pages?

+1  A: 

Hi I was able to do it with this code.

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton delete = (LinkButton) e.Row.FindControl("DeleteLinkButton");
            delete.Visible = false;
        }
    }
You might want to format your code a little better
Kane
hey kane sorry for that format. I have again tried it but the editor is not giving output as i want. :(