I have a gridview that allows paging and uses a row command event.
The gridview column that caused the issue is:
<asp:LinkButton ID="LinkButton1" Runat="server" OnClientClick="return confirm('Are you sure you want to delete this item?');"
CommandName="ConvertDelete" CommandArgument="<%# Container.DataItemIndex %>">Delete</asp:LinkButton>
<ItemStyle BackColor="#FFC0C0" Font-Size="X-Small" />
The codebehind code that causes the issue is:
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
Dim row As GridViewRow = gridview1.Rows(index)
The error reads:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
The index value is greater than the page size. Everything works on Page 1 but fails on all other pages.