ASP.Net VB to delete row from gridview
Posted on 2011-09-19
I have a page with a dynamically created grid view. I have added AutoGenerateDeleteButton = true and AddHandler myGridview.RowDeleting, AddressOf Me.gvrowdel
The problem I have is I cant figure out how to reference the datakeynames value for the row that was clicked to delete the correct line in my sql.
If it was a GridViewCommandEventArgs I would use something like the below:
However this is not a part of the GridViewDeleteEventArgs.
There is the e.rowindex which returns the row I clicked but I'm unsure how to use this to get the value of cell(1) (which is my ID/datakeys value)
Can any one help.