Using a DevExpress XtraGrid and Trying to Move Records Up or Down


Author
Message
Buffie
Buffie
StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)
Group: StrataFrame Users
Posts: 119, Visits: 11K
I have a DevExpress XtraGrid filled with a Business Binding Source. I am trying to follow a Sample that allows user to move a record up or down by clicking a button.

But, the Sample uses a DataTable and not a BBS or BO so I am having trouble converting some of the code.

Dim view As GridView = gridView1
view.GridControl.Focus()
Dim index As Integer = view.FocusedRowHandle
If index <= 0 Then
Return
End If
Dim row1 As DataRow = view.GetDataRow(index)
Dim row2 As DataRow = view.GetDataRow(index - 1)
Dim val1 As Object = row1(OrderFieldName)
Dim val2 As Object = row2(OrderFieldName)
row1(OrderFieldName) = val2
row2(OrderFieldName) = val1
view.FocusedRowHandle = index - 1


What I am not sure how to convert is the lines that involve the DataRows.

I would appreciate any help I could get and if anyone has a Xtragrid allowing moving records I would appreciate any hints or advice.

TIA


Reply
Buffie
Buffie
StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)StrataFrame User (271 reputation)
Group: StrataFrame Users
Posts: 119, Visits: 11K
With Edhy's help and expertise I (we) were able to get the move to work in the DevExpress Grid.  Edhy is such a valuable resource....

If someone is interested in the code I will gladly post it.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search