Datagrid Imagebutton Delete Problem

Datagrid Imagebutton Delete Problem

am 08.04.2008 18:49:33 von Erik Lautier

Hi, I'm running into a bit of a headache trying to use an imagebutton
in my datagrid; if I use a linkbutton in a buttoncolumn, it all works
perfectly, but the second I switch to an imagebutton in a
templatecolumn, nothing happens...I don't get an error, it's just that
the row is not deleted. Relevant code is below; would really
appreciate a helping hand. Thanks.

ondeletecommand="Delete_Item" runat="server">




AlternateText="Delete" ImageUrl="buttons/delete.gif"
CommandName="Delete">







Sub Delete_Item(s As Object, e As DataGridCommandEventArgs)
objDT = Session("Cart")
objDT.Rows(e.Item.ItemIndex).Delete()
Session("Cart") = objDT

dgCart.DataSource = objDT
dgCart.DataBind()
End Sub