Setting GridView SelectedIndex based on a row value

  • Thread starter Thread starter Jay Pondy
  • Start date Start date
J

Jay Pondy

I have a datasource with 2 columns PKID and Description.

The datasource is bound to a sortable GridView where the PKID field is NOT
visible.

If the user has a row selected before the grid is sorted I want to select that
same row after the sort.

How is this done using the GridView?
 
Set the DataKeyNames property to "PKID". Then you don't even to declare a
column that contains this field.
 
Back
Top