DeleteImageUrl in CommandField properties does not work

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.
 
P

Paul

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);//
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top