Protected Sub ItemDB(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If CInt(ViewState("tot")) = 1 Then
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim btn As Button = CType(e.Item.Cells(10).FindControl("delBtn"), Button)
btn.Visible = False
End If
End If
End Sub
this will hide the delete button if the i have one recored in data grid this code works well now when i click the edit button then the delete again show so tell me where should i write the code that will hide the delete button again because its not needed.
thanx in advance