Drag and Drop between RadGrid and RadTreeView

Thread is closed for posting
16 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 06 Feb 2008 Link to this post

    Requirements

    To convert code from posted project(s) Telerik online converter
    RadControls version

    Telerik.Web.UI v2008.1 515 (Q1, SP1)
    .NET version

    2.x
    Visual Studio version

    2005
    programming language

    C#
    browser support

    all browsers supported by RadGrid and RadTreeView


     
    PROJECT DESCRIPTION
    This project shows how to Drag and Drop Items from RadGrid to RadTreeView and vice-versa.

    Drag and Drop in RadGrid -> RadTreeView direction is handled by custom JavaScript logic.

    Drag and Drop in RadTreeView -> RadGrid direction is handled by using the built-in Drag and Drop functionality of the RadTreeView.

    The project also shows a sample approach to the case when RadTreeView and RadGrid are in MasterPage and ContentPage respectively.
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 06 Feb 2008 Link to this post

    Can this be enhanced to support two-way drag and drop support? In other words, drag from a TreeView on to a RadGrid? That would obviously be harder since the Grid may have to load data based on the key to completely fill the row, but it's conceivable that a scenario with drag-and-drop would want two-way support.

    Very cool demo, though! Great work.

    -Todd
  3. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 08 Feb 2008 Link to this post

    Hi Todd Anglin,

    I agree that it would be better if the Drag And Drop can happen in both directions (RadGrid<->RadTreeView). I will try to update the project as soon as possible.

    Kind regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Colceriu Radu
    Colceriu Radu avatar
    4 posts
    Member since:
    Jan 2004

    Posted 15 Feb 2008 Link to this post

    I'm looking at that example since yesterday evening, still trying to find out what the relevant parts of it are. Some documentation would have been really nice. Also the code is horribly formatted and absolutely not commented.

    The next thing is, that I first have to upgrade my current project to this new Version, which doesnt seem to be quite easy, since the whole structure changed. Another ordeal with telerik controls.
  5. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 18 Feb 2008 Link to this post

    Hi Colceriu Radu,

    I added some comments to the code used in the project attached to this thread. If something remains unclear, please let me know. I will try to provide further clarifications if needed.

    Regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 13 Mar 2008 Link to this post

    Nick-

    Any update on the progress updating the demo to show the RadTreeview to RadGrid drag-and-drop operation? I've talked to more people recently that would love to see this two-way operation.

    Thanks-
    Todd
  7. DENIS LABERGE
    DENIS LABERGE avatar
    2 posts
    Member since:
    Sep 2007

    Posted 02 Apr 2008 Link to this post

    is it possible to modify this sample to allo dragging multiple rows from the grid to the tree?
  8. charles
    charles avatar
    1 posts
    Member since:
    Apr 2007

    Posted 12 May 2008 Link to this post

    I too would like to see drag and drop of multiple grid rows onto a treeview node. Thanks.
  9. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 03 Jun 2008 Link to this post

    Hello there,

    @Todd:
        I have updated the project to show both Drag and Drop directions.

    @DENIS LABERGE, charles:
        Currently, we are working on a CL which will illustrate dragging and dropping of multiple rows from RadGrid to RadTreeView (using the built-in drag and drop functionality of the RadGrid). Hopefully, the project will be published very soon.

    Any comments/feedback are appreciated.

    Regards,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 04 Jun 2008 Link to this post

    Hello again,

    A CL Project showing Multi Row Drag and Drop from RadGrid to RadTreeView has been published.

    You can check it out here.

    Regards,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Christian
    Christian avatar
    16 posts
    Member since:
    Mar 2008

    Posted 21 Sep 2008 Link to this post

    Hi,

    what are the steps to use your sample in the way that treeview is on the masterpage and grid inside a content area?

    Thanks!
  12. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 24 Sep 2008 Link to this post

    Hello Christian,

    This could be achieved in various ways but the basic idea is the same - the correct RadGrid and the MasterTableView IDs should be available on the client. I have modified the sample project to illustrate one possible implementation.

    Please download it and see it for the details.

    Greetings,
    Simon
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. Peter
    Peter avatar
    3 posts
    Member since:
    Oct 2008

    Posted 25 Feb 2009 Link to this post

    Hi

    How do I get the RadAjaxManager1_AjaxRequest Method executed if I have only a AjaxManagerProxy on my Page? There is no property "OnAjaxRequest" on the proxy. I found some kind of solution here: http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajaxmanagerproxy-issue.aspx but I don't get it working for this drag-drop function.

    Thanks for help!
  14. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 25 Feb 2009 Link to this post

    Hey Peter-

    Assuming your goal is to write some server-side code that handles a Ajax event fired by JavaScript on a ContentPage (with a AjaxManager on your MasterPage, and a AjaxManagerProxy on your content page), you can use this snippet:

    //In your ContentPage OnPageLoad 
    protected void Page_Load(object sender, EventArgs e) 
        //Get reference to AjaxManager (from Master) 
        var manager = RadAjaxManager.GetCurrent(this); 
     
        //Create a new delegate to handle the AjaxRequest event 
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(YourContentPage_AjaxRequest); 
     
        //Add your ajax settings programmatically (with ref to Master manager) 
        manager.AjaxSettings.AddAjaxSetting(manager, this.controlToUpdate); 
     
    //Handle the Ajax event in your ContentPage code behind 
    private void YourContentPage_AjaxRequest(object sender, AjaxRequestEventArgs e) 
        //Optionally process supplied event arg 
        switch (e.Argument) 
        { 
           case "SomeEventArgument"
           //Do something 
           break
        } 

    This allows you to handle your ajax requests in your content page code when they're fired from the client, like this:

    function someJavaScriptFunction() { 
       //Get reference to RadAjaxManager on page 
       if (radManager == null
           radManager = $find('<%= RadAjaxManager.GetCurrent(this).ClientID %>'); 
     
       //Fire ajax request (optionally pass an event arg value) 
       radManager.ajaxRequest("SomeEventArgValue"); 

    Hope that helps!
    -Todd
  15. Rajesh
    Rajesh avatar
    1 posts
    Member since:
    Feb 2009

    Posted 05 Mar 2009 Link to this post

    I am working with latest trial download of ASP.Net controls. I need functionality to drag and drop from radgrid to radtreeview control. I downloaded this solution from the forum but am getting this error:
    Unable to cast object of type Telerik.web.ui.radgrid to Telerik.web.ui.gridtableview

    Can you please help with that?
    Thanks,
    -raj
  16. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 05 Mar 2009 Link to this post

    Hi Rajesh,

    Please open a formal support ticket and send us a runnable project where the issue could be clearly observed. We will examine your code and will provide you with a solution or a workaround.

    Thank you.

    Best wishes,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top