This is a migrated thread and some comments may be shown as answers.

Drag Drop Reorder

2 Answers 120 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 12 Nov 2012, 02:46 PM
I have a screen with a radgridview that is bound.  I am looking for a way to allow the user to click a row drag to a new location in the grid and drop and then save the order back to the sql tables.  I have a field in the table called PrintOrder that will contain the order that is displayed on the screen.  I have read some of the post about how unbound it works and some of the work arounds for bound items.  In the grid I allow the users to group, reorder columns, hide and show columns.  Would it be better to load the grid unbound, or is there a way around the bound issue.  I have seen the code with the PreviewDragDrop and set the e.Handled to true, but not sure how to drop the row in the location.  I can get it to look like you can drag and drop but when droped nothing happens.
void TestingItemView_PreviewDragDrop(object sender, Telerik.WinControls.RadDropEventArgs e)
{
    e.Handled = true;
}

after the handle how do I drop.  I assume the besthing to do would be to loop throught the grid and update the table with the new order.

2 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 12 Nov 2012, 02:53 PM
Hello,

Please check out my code library project related to this Drag and drop in bound mode.

You should be able to get all the info you require from that one, and you don't need to iterate trough the entire grid.

Best Regards,
Emanuel Varga
WinForms MVP
0
Eric Klein
Top achievements
Rank 1
answered on 12 Nov 2012, 05:19 PM
Cool thanks
Tags
GridView
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Eric Klein
Top achievements
Rank 1
Share this question
or