Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Maintaining the selected row after sorting a DataGridView

$
0
0

Hi,

Simple question, hopefully there's a simple answer:

How can I maintain the same selected row even after a sort on a DataGridView?

In other words, after new items have been added to the binding source and a sort has been forcefully been carried out (in the custom BindingList), how can I ensure that the selected row is the same row as the one selected before the sort?

Bear in mind, I'm doing the sorting in a custom BindingList so I can't just handle the Sorted or SortCompare events and implement my own logic there.

Thanks,

Jiten


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>