Drag and Drop value from one cell of grid to another cell

4 posts, 0 answers
  1. Sheo
    Sheo avatar
    3 posts
    Member since:
    Mar 2013

    Posted 07 Mar 2013 Link to this post

    Hi,
    I am new to Kendo and started working with the trial version. I have a scenario where in a Grid User should have the ability to drag value from one cell in grid to another cell and also drag one cell value from one grid to another. I have tried searching but cudn't finad any such demo. I have used this demo http://jsfiddle.net/JBeQn/ 
    I tried changing the source but it is not working. Currently when i drag and drop in the grid in demo value of two columns are dragged i just need that only one value , say only value of text column should be dragged. 
    I surely think I can get lots of input on this here.
    Thanks
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2892 posts

    Posted 11 Mar 2013 Link to this post

    Hello Sheo,

    Kendo Grid does not support drag-n-drop reordering out of the box. The example that you found uses KendoUI Drag and Drop component to achieve similar functionality.

    I am not sure if I understood correctly what exactly you would like to achieve. If you want to drag the value of only one column you can make only the corresponding cell draggable or customize the hint used in the jsFiddle example. For more information please check the Draggable API reference.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Mark
    Mark avatar
    1 posts
    Member since:
    Jun 2011

    Posted 11 Mar 2013 Link to this post

    I have the same question that the original poster had regarding drag-and-drop between two grids. I also am on a Trial period for now, my company has a full version of DevCraft Ultimate and we are planning on using KendoUI for our next generation application, largely because we have been impressed with your responsiveness in these forums in the past.. 

    My search of the web has turned up very little examples for this scenario. I am a newbie with jQuery/jscript, and could use a working example of this scenario using KendoUI. I'm coming from a ASP.NET web forms background, now using ASP.NET MVC 4 for the first time.

    Ultimately, my app will need to know the database key (at a minimum) of the row being "dragged", So, it would be nice if the example could include source data to be received by the "drop" target cell.

    Thanks for you help.
    Mark Northup
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2892 posts

    Posted 13 Mar 2013 Link to this post

    Hello guys,

    I updated the example so it shows how to get the dataItem of the row that is currently being dragged.
    hint: function(e) {
        var dataItem = grid.dataItem(e); //get the dataSource item
        return $('<div class="hint">ID: ' + dataItem.id + '</div>'); //build the hint
    }

    You can test the solution here: http://jsbin.com/itawuq/2/edit

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top