DeleteImageUrl in CommandField properties does not work

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi I have a gridview with one of the columns as a command field and the
buttonType set as Link. I also se the DeleteImageUrl as I want to display a
red x for the user to click to delete the row. For some reason the image
does not show up. I tried clearing the delete text as well. If I change the
button type I can get the image to show up but this seemed to have changed
the functionality as it causes a runtime error. I am using the RowCommand to
get the index of the selected row on the delete action.
Any suggestions, Thanks.
 
Hi thanks for the response. Changing the button type to image does display
the desired image but for some reason when the user select the row to delete
the gridview_RowCommand runs twice.
I am able to get the index ok but am using it to remove an item from a list
so the second time the item has already been removed and an error occures.
I am redirecting back to the same page at the end of the routine, see below.
in the gridview_RowCommand I have
Int32 index = Convert.ToInt32(e.CommandArgument);
discreplist.RemoveAt(index);//removes discrepancy from
list
Response.Redirect("~/webpage.aspx);//
 
Back
Top