RowDeleting i Gridview raderar två rader istället för en. När jag ska radera en rad så raderas två istället. Ett exempel är att när jag klickar på raden med listId 32 så raderas den raden och den rad med närmast lägsta listId.
Så här står det när jag raderar den rad med lägst listId:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
Line 29: protected void Grid_RowDeleting(Object sender, GridViewDeleteEventArgs e)
Line 30: {
Line 31: string listId = Grid.DataKeys[e.RowIndex].Value.ToString();
Line 32: bool success = CatalogAccess.DeleteAdressLista(listId);
Line 33: statusLabel.Text = success ? "Delete successful" : "Delete failed";
Har inte kollat in din kod, men jag vet att det finns en bugg i Gridview och RowDeleting, men den uppenbarar sig bara om man använder en bildknapp för att radera raden. Gör du det?