views:

349

answers:

1

I am using Telerik's WinForms controls and have a radGridView which is bound to a bindingsource to display my data. I would like to expand on the functionality of this a bit to give users an extra way to order the records.

I have added two command buttons to the gridview (Up, Down) to help facilitate this functionality. Basically, when the "Up" button is clicked, I would like the current row to switch places with the row above; if the "Down" button is clicked, the current row should switch places with the row below.

Example data:

1
2
3
4
5

If the "Up" button is clicked on the third row, the data should then look like so:

1
3
2
4
5

If the "Down" button is clicked on the third row, the data should look like this:

1
2
4
3
5

How can I achieve this? Do I have to modifiy the bindingsource positions of these rows, or the gridview row's index? Another way? Any examples are greatly appreciated!

A: 

Anyone have any ideas?

Robert
Decided to use drag and drop instead of up/down buttons. All is well.
Robert