Setting GridView SelectedIndex based on a row value

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?
 
C

Christopher Reed

Set the DataKeyNames property to "PKID". Then you don't even to declare a
column that contains this field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top