|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataGridView : selected-record changes after sorting ???using the DataGridView (.NET 2005) : I have a row currently selected in the Grid (say the 3rd row showing 'Product3') Now, when I click on a column to sort the records is the 'Product3' row located as first row in the Grid but not selected (highlighted) anymore. The position of the selected (highlighted)-row doesn't change and is still located on the 3rd row, thus showing a dfifferent product. I don't want this. When sorting the records do I want to preserve the selection on the same record not on the same row. How can I solve this ? thnx Chris Chris, I too have noticed this issue with the DataGridView. Windows
Explorer "remembers" the selected items after a sort, so it would seem logical that the DataGridView would behave in the same manner. One can argue whether this rises to the level of a bug, but I believe in the least it's a design flaw. In any case... I think the only way to get around this is to do the "remembering" yourself. As in, before the sort, store all of the selected items, then after the sort, reselect these items. Maybe someone else can suggest a more elegent solution whick takes advantage of the native abilities of the DataGridView, but when I ran into this issue, this solution was what came to mind. - Mitchell S. Honnert Show quoteHide quote "cc" <cmr***@yahoo.com> wrote in message news:44154573$0$16290$ba620e4c@news.skynet.be... > Hi, > > using the DataGridView (.NET 2005) : > I have a row currently selected in the Grid (say the 3rd row showing > 'Product3') > > Now, when I click on a column to sort the records is the 'Product3' row > located as first row in the Grid but not selected (highlighted) anymore. > The position of the selected (highlighted)-row doesn't change and is still > located on the 3rd row, thus showing a dfifferent product. I don't want > this. > > When sorting the records do I want to preserve the selection on the same > record not on the same row. > > How can I solve this ? > > thnx > Chris > >
Adding Button Programmatically REDUX - STILL NONFUNCTIONAL
ComboBox ReadOnly Problem with DataRelation Direct input into DataGrid? Help with first multi-thread app pls? Please help! Database won't update Visual Basic .net and DirectX Stroppy Porgram Access a textbox on a report form From Windows application to ASP.Net Web Application |
|||||||||||||||||||||||