drag and drop between gridview and treeview

7 posts, 1 answers
  1. Mohamad Javad
    Mohamad Javad avatar
    39 posts
    Member since:
    Jul 2014

    Posted 02 Jul 2014 Link to this post

     hi

    in ASP.NET AJAX (NOT SilverLight or ... Just For ASP.NET ajax):
    How can I drag n drop multiple gridview rows to Treeview node?
    How can I  drag n drop between  gridview and treeview?
    Please Help me.
    thanks

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2014 in reply to Mohamad Javad Link to this post

    Hi Mohamad Javad,

    Please have a look into Multi Row Drag and Drop from RadGrid to RadTreeView  code library to achieve your scenario.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mohamad Javad
    Mohamad Javad avatar
    39 posts
    Member since:
    Jul 2014

    Posted 02 Jul 2014 Link to this post

    Thanks
    It's look like a good sample. Thanks for that. But i need more ..
    I need darg and drop (gridview to treeview)    AND   ( treeview to gridview )   TOO.
    but  That Sample Not darg and drop treeview to gridview.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2014 in reply to Mohamad Javad Link to this post

    Hi Mohamad Javad,

    Please have a look into this online demo which shows RadTreeView Drag-and-drop.

    Thanks,
    Shinu.
  6. Mohamad Javad
    Mohamad Javad avatar
    39 posts
    Member since:
    Jul 2014

    Posted 02 Jul 2014 Link to this post

    thanks very lot
  7. Mohamad Javad
    Mohamad Javad avatar
    39 posts
    Member since:
    Jul 2014

    Posted 06 Jul 2014 Link to this post

    hi
    when i drage row from gridview and Drop to Treeview i dont know which node is click(for drop) in server side.
    please help me.

    the folw code to detrmin which node is dropped (in last post) not working in Page with masterPage and server side tree.
  8. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jul 2014 in reply to Mohamad Javad Link to this post

    Hi Mohamad Javad,

    Unfortunately I couldn't replicate the issue at my end. Please see the below code snippet to get the RadTreeView node for drop.

    C#:
    protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e)
    {
        if ((!String.IsNullOrEmpty(e.HtmlElement)) && (e.DraggedItems.Count > 0))
        {
            string nodeValue = nodeValueHiddenField.Value.Trim();
            Telerik.Web.UI.RadTreeNode node = RadTreeView1.FindNodeByValue(nodeValue);
            foreach (GridDataItem draggedItem in e.DraggedItems)
            {
                node.Nodes.Add(new RadTreeNode(draggedItem["Column1"].Text, draggedItem["Column2"].Text));
            }
        }
        RadTreeView1.ExpandAllNodes();
    }

    Please provide your code if it doesn't help.
    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017