2

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?

animuson
  • 53,861
  • 28
  • 137
  • 147

2 Answers2

1

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;
        }
    }
Matt Mitchell
  • 40,943
  • 35
  • 118
  • 185
  • hey kane sorry for that format. I have again tried it but the editor is not giving output as i want. :( –  Jul 24 '09 at 12:21
0

Try Creating a custom page and you will have all control over default pages template. Look following video explains how to do it.

http://www.asp.net/web-forms/videos/aspnet-dynamic-data/how-do-i-make-custom-pages

bijayk
  • 556
  • 3
  • 18