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

Assign records to specific row with radgrid drag and drop?

2 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 05 Nov 2009, 03:39 PM
I have 2 radgrids one with jobs and the other with users I would  like to be able to Multi drag and drop jobs and assign them to specific users in the other grid is this possible with radgrid drag and drop, if so could you provide a vb example

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 06 Nov 2009, 08:10 AM
Hi,

Here is a code library on Multi Row Drag and Drop from RadGrid to RadTreeView . You can use the same in your scenario for multi drag and drop between two grids
http://www.telerik.com/community/code-library/aspnet-ajax/general/multi-row-drag-and-drop-from-radgrid-to-radtreeview.aspx

I have implemented the same in a scenario where I have two grids ,with the second grid having a RadTreeView in the NestedViewTemplate. I am able to drag multiple items from the first grid and add  it to a specific row's treeview  in the second grid .
You need to find the row  index on mouse hover of the second grid and assign it to a hidden field in the onRowDropping client  event of the first  grid .

C#
protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e) 
   { 
        if (e.DraggedItems.Count > 0) 
        { 
            int index = rowindexHiddenField.Value; 
            GridDataItem item = (GridDataItem)RadGrid2.MasterTableView.Items[index]; 
            item.Expanded = true
            GridNestedViewItem nestedView = (GridNestedViewItem)item.ChildItem; 
            RadTreeView RadTreeView2=(RadTreeView)nestedView.FindControl("RadTreeView2"); 
            foreach (GridDataItem draggedItem in e.DraggedItems) 
            { 
                RadTreeNode node = new RadTreeNode(draggedItem["Column1"].Text, draggedItem["Column2"].Text); 
                RadTreeView2.Nodes.Add(node); 
            } 
        } 
  } 


Thanks,
Shinu



0
Robert
Top achievements
Rank 1
answered on 11 Nov 2009, 06:36 PM
Thanks Shinu,
But I am afraid I am kinda lost on the Java end of this do you happen to have a simple java block that would show me how this is done between radgrid1 and radgrid2. The Datakeyname on radgrid1 is Dictationid and on radgrid2 it is Userid.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Share this question
or