DataView, DataGrid sorting and incorrect SelectedIndex

B

brian_is_online

Hi all,

I have a DataGrid which is bound to a DataView to return search
results. The DataGrid headers allow sorting so when clicked I rebind
the DataView with the appropriate Sort property. To save expensive
database calls, the DataView is used instead of re-querying.

I've now got a problem where if I select a row in the DataGrid, then
sort the column, the position maintained is the same, but the wrong row
is now selected due to the search. Does anyone have any idea how I can
persist the correct SelectedIndex property of the DataGrid. Note that
the data I'm binding does not have a unique key.

Thanks in advance.

B.
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top