Hi Terry,
Basically this sample is expecting you have an Order field which they change in the datarow object and it is reflected in the grid because the grid is already ordered by that column named "Order" in their sample.
In your case that column is "
JudgesSheetPositionNumber" so basically we would just do the same but at the BO level, assign the "
JudgesSheetPositionNumber" value of the selected row to the value next or prior based on the Up/Down button but keep in mind that that will make the BO dirty and you will have to save it to keep the new position number by either asking the user or save it each time the position changes.
When using
' Assuming you are moving Down
Dim index As Integer = view.FocusedRowHandle
If index >= view.DataRowCount - 1 Then
Return
End If
' Here create an instance of the BO with the record where the grid is focused
Dim boInGridView As New ResultsPerfsChecksTimedEventBO
boInGridView = TryCast(Me.GridView1.GetRow(index), ResultsPerfsChecksTimedEventBO1)
boInGridView.JudgesSheetPositionNumber = (boInGridView.JudgesSheetPositionNumber + 1)
Obviously you would need to add validations as to make sure when in 1st position you cannot move up or when at the end you cannot move down.
Try to make the functionality works moving Down and Up fist, then focus on make the Drag/Drop operations.
Please let me know if that works for you?
P.S.
Forgot t mention that this whole logic is based on the current sort order enforced in the grid by the sort column "JudgesSheetPositionNumber" Without this sort in place you will not see the record being moved from one row to another in the grid.
gridView1.Columns("JudgesSheetPositionNumber").SortOrder = DevExpress.Data.ColumnSortOrder.Ascending
gridView1.OptionsCustomization.AllowSort = False
Edhy Rijo