Drag Drop Reorder

3 posts, 1 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 12 Nov 2012 Link to this post

    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. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 12 Nov 2012 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 12 Nov 2012 Link to this post

    Cool thanks
Back to Top