I’m having a problem with the Gridview control. I populate the gridview. I’ve set up code so it will sort when I click on the column headings; alternating between ascending or descending. It appears correctly in the gridview after sorting. When I select a row in the gridview I can programmatically get the selected index number. But when I pull the values for the selected index, the values are not for the row I selected. They are for the row that was originally in that position before sorting.
It seems like the SelectedIndex property is actually getting sorted with the row, so when I select the first row, I get selected index of 0, but the values in the row are for the row that was in that 0 position before sorting. Can anyone tell me what I’m doing wrong? I have some code examples and screen shots in a Word document but it’s about 7 pages long so I didn’t want to post it here unless someone needed to see it.
It seems like the SelectedIndex property is actually getting sorted with the row, so when I select the first row, I get selected index of 0, but the values in the row are for the row that was in that 0 position before sorting. Can anyone tell me what I’m doing wrong? I have some code examples and screen shots in a Word document but it’s about 7 pages long so I didn’t want to post it here unless someone needed to see it.