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


Author
Message
Buffie
Buffie
Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)
Group: StrataFrame Users
Posts: 119, Visits: 11K
I did not try the code because I assumed it would not work.

Here is the Link:

https://www.devexpress.com/Support/Center/Example/Details/E764
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Terry,

I use the XtraGrid but never had the need to move records up/down nor I have not seen that sample you mention.

The gridview manage the records via its row handle index which it is used to locate the datarow record in the view.  The SF BBS should be able to internally detect the movement of the view row index and translate that to the SF BO.CurrentRowIndex, so I believe your sample code should work just fine.

Please post the link to the DevExpress sample and I will take a look at it.

Edhy Rijo

Buffie
Buffie
Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 reputation)Advanced StrataFrame User (573 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


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