Home Forums WinForms controls Xceed Grid for WinForms Cannot get MoveCurrentRow to work… Reply To: Cannot get MoveCurrentRow to work…

User (Old forums)
Post count: 23064

First, MoveCurrentRow refers to the CurrentRow property, which means the row that is currently selected. If you change the CurrentRow property, it is the row that is currently selected that changes. The MoveCurrentRow method is in fact changing the CurrentRow property. It is not a way to move a specific row around the gird.

Second, it is not possible to change the position of a row within the DataRows collection. You need to use a workaround to do this. Basically, you need to have an invisible column which is in fact an index of the rows on which you sort the grid. Then you simply change the index of a row, and resort the grid.

Here is a <a href=”http://www.xceedsoft.com/cs/download/XceedGrid/CSharp/MoveRows.zip”>sample</a&gt; application that shows how to accomplish this.

Imported from legacy forums. Posted by André (had 3024 views)