Took me a while to troubleshoot this as I still am not highly experienced in ASP.net or C# but I have found an odd behavior, at least to me. When my page loads I am creating a new GridView and filling it with null strings so it will appear. One of my columns is made up of another gridview so I need to do the same for that. So in the GridView Row Event I take the current Row Index and append it to a string to access a viewstate of the same name subTable#, but I wasn't working. Turns out the first index being returned was -1, then 0, then another -1. So as a quick fix I added an if > 0 clause but I'd like to know why it's giving me a -1 at all?
View Complete Post