Drag and drop grid rows from one grid to another and to a recycle bin

Thread is closed for posting
13 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 28 Nov 2006 Link to this post

    Requirements

    RadControls version

    RadGrid, RadAjax
    or
    Telerik.Web.UI 2007.3.1425
    .NET version

    2.x, 3.x
    Visual Studio version

    2005 / 2008
    programming language

    C#, VB, Javascript
    browser support

    all browsers supported by RadControls


     
    PROJECT DESCRIPTION
    The example demonstrates how to drag and drop a grid row between grid instances and how to delete a grid row (dropping it onto a div "masked" as a recycle bin).
    Note that the two grids should have the same column structure, Skin="None" and predefined style settings (Styles.css) because the handlers and appearance are related with them. Event handlers for onmousedown, onmouseover and onmouseout (browser-dependant) for every row and onmouseup and onmousemove for the document are hooked inside the RowCreated client-side event handler.
    After dragging (mouse down, mouse move, mouse over and mouse out) and dropping (mouse up) a request to the server is made with the following arguments:
    • the ID of the source grid
    • the index of the dragged row
    • the id of the grid/div the row is being dropped over
    • the index of the target row (where we dropped the dragged row in the destination grid -- we will insert the dragged row before the target row in this example)

    On the server the row is accessed by its index and the current page of the grid which holds it. If the row is dropped on the recycle bin, it is deleted from the grid it came from. If it is dropped over the other grid instance, it is removed from its original grid and is inserted at the supplied index in the destination grid structure.

  2. DEF671EC-C454-4244-BBBF-F7EEFBBCF2CB
    DEF671EC-C454-4244-BBBF-F7EEFBBCF2CB avatar
    2 posts
    Member since:
    Mar 2006

    Posted 12 Mar 2007 Link to this post

    This feature for drag&drop is very important to us. However it appears that the project does not allow you to get the row index of the target dropped grid. I have the need to drag a row and drop it on top of or down below another row so that I can insert the moved row into the dropped location. But it seems the project cannot pass the row index of the target grid row. Is this true? How can we accomplish it then? Thanks for the help.
  3. FCA2D288-F6EC-4724-BAB8-B03BBE745D7B
    FCA2D288-F6EC-4724-BAB8-B03BBE745D7B avatar
    2363 posts
    Member since:
    Mar 2023

    Posted 13 Mar 2007 Link to this post

    Hello Eddy,

    Thank you for contacting us.

    We have attached a modified sample application that demonstrates the desired functionality (source row is inserted before the target row in this example).

    Hope this helps.


    Kind regards,
    Manuel
    the telerik team
  4. D324D443-1E43-4148-ABA0-2451049B532C
    D324D443-1E43-4148-ABA0-2451049B532C avatar
    6 posts
    Member since:
    Jun 2007

    Posted 15 Jun 2007 Link to this post

    This is the exact functionality I am looking for, though I cannot open the attached solution to make sure.  I'm using VS2005 and cannot open the project.  I'm also new to this.
    Help please.
  5. FCA2D288-F6EC-4724-BAB8-B03BBE745D7B
    FCA2D288-F6EC-4724-BAB8-B03BBE745D7B avatar
    2363 posts
    Member since:
    Mar 2023

    Posted 18 Jun 2007 Link to this post

    Hi kawaguchi,

    We have attached the VS2005 version of the project for your convenience.


    Sincerely yours,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. D324D443-1E43-4148-ABA0-2451049B532C
    D324D443-1E43-4148-ABA0-2451049B532C avatar
    6 posts
    Member since:
    Jun 2007

    Posted 20 Jun 2007 Link to this post

    Hello, and thank-you for providing me with a compatible solution.
    Perhaps you can help set me on the right path as well?

    Rather than sorting items from 2 grids, I need the functionality to drag an item from grid1, and match it up with an item from grid2.  The items shouldn't be removed or readded to the target grid - they need to remain in place, however alter their content.  When each item from grid1 has been matched it needs to alter a column indicating which row it was dropped on.

    Can you help me toy with this?
    I'd be very greatful.
  7. D324D443-1E43-4148-ABA0-2451049B532C
    D324D443-1E43-4148-ABA0-2451049B532C avatar
    6 posts
    Member since:
    Jun 2007

    Posted 20 Jun 2007 Link to this post

     double post
  8. D324D443-1E43-4148-ABA0-2451049B532C
    D324D443-1E43-4148-ABA0-2451049B532C avatar
    6 posts
    Member since:
    Jun 2007

    Posted 20 Jun 2007 Link to this post

    Also wondering what is available in C#.  I saw another thread with similar discussion here:
    http://www.telerik.com/community/forums/thread/b311D-kaahh.aspx

  9. FCA2D288-F6EC-4724-BAB8-B03BBE745D7B
    FCA2D288-F6EC-4724-BAB8-B03BBE745D7B avatar
    2363 posts
    Member since:
    Mar 2023

    Posted 21 Jun 2007 Link to this post

    Hello kawaguchi,

    We have attached a modified project in C# that achieves the desired functionality.

    Hope this helps.


    All the best,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. 744D3DB8-E27C-4DEE-ADF3-D54D7F4AEB2C
    744D3DB8-E27C-4DEE-ADF3-D54D7F4AEB2C avatar
    1 posts
    Member since:
    Feb 2006

    Posted 09 Dec 2007 Link to this post

    Hi please help me 
    I have a 2 grids and when  onRowCreated  event attached its 2 grids the argument (row ) row.RealIndex in this grids return same indexes
    second grid row.RealIndex return some indexes like grid 1

  11. FCA2D288-F6EC-4724-BAB8-B03BBE745D7B
    FCA2D288-F6EC-4724-BAB8-B03BBE745D7B avatar
    2363 posts
    Member since:
    Mar 2023

    Posted 11 Dec 2007 Link to this post

    Hello Samvel,

    Please elaborate how is this related to the code library project attached to this thread -- have you performed any modifications on it or are you using the provided source as it is -- we were unable to reproduce any problems with the latest attached sample project.


    Kind regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. 6930AF50-8A6F-4E1C-A0B9-23DCD3C1FDD4
    6930AF50-8A6F-4E1C-A0B9-23DCD3C1FDD4 avatar
    8 posts
    Member since:
    Nov 2007

    Posted 05 Mar 2008 Link to this post

    Hi Manuel,

    Would you be able to post a version of the drag and drop from one grid to another grid using the Prometheus grid? I am really interested to see how you weild the Asp.Net Ajax entensions in this example since I will be creating something similar to this example.

    Thanks
  13. FCA2D288-F6EC-4724-BAB8-B03BBE745D7B
    FCA2D288-F6EC-4724-BAB8-B03BBE745D7B avatar
    2363 posts
    Member since:
    Mar 2023

    Posted 07 Mar 2008 Link to this post

    Hi Bart,

    We have attached the Prometheus counterpart of the last modified version of the example for your convenience.

    Hope this helps.


    Regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.