I set the sort expression for a column in a grid view. Then sort the column by clicking on Header. Upto this point fine.
However, when I select a gridView row using the select button which is autogenerated:
<asp:GridView runat="server" ID="test" DataSourceID="sourceEmployees"
AutoGenerateSelectButton="true">
After selecting a row if I sort the Column by clicking on Header, the GridView still has the old row selected. The intially selected value is lost. If i Select employeeID value 7, the 7th row remains selected even when I sort the Column in descending order, Although my employeeId value 7 has moved to different row. [ here its moved to 4th row as I have total 10 employees ]
What more I need to implement to make sure No matter the way user sorts the GridView, always the initially selected employeeID remains selected.