Drag and Drop between RadGrid and RadTreeView

Thread is closed for posting
16 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 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. C002BEFC-0EA7-4858-A856-E788F4D4DBFA
    C002BEFC-0EA7-4858-A856-E788F4D4DBFA 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. 19646D24-82B2-48BE-8363-68015F20812F
    19646D24-82B2-48BE-8363-68015F20812F avatar
    3997 posts
    Member since:
    Jan 2017

    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. EFFBEAFC-5DF6-4F4D-AF87-3DD0D080F942
    EFFBEAFC-5DF6-4F4D-AF87-3DD0D080F942 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. 19646D24-82B2-48BE-8363-68015F20812F
    19646D24-82B2-48BE-8363-68015F20812F avatar
    3997 posts
    Member since:
    Jan 2017

    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. C002BEFC-0EA7-4858-A856-E788F4D4DBFA
    C002BEFC-0EA7-4858-A856-E788F4D4DBFA 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. 7D980203-9720-434A-85CE-4633A7A235AF
    7D980203-9720-434A-85CE-4633A7A235AF 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. 95901D71-B653-4B5D-8314-4707DB29FAB5
    95901D71-B653-4B5D-8314-4707DB29FAB5 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. FA9EEAA8-F49E-465B-9E32-1F857EDDC09E
    FA9EEAA8-F49E-465B-9E32-1F857EDDC09E avatar
    2281 posts
    Member since:
    Jan 2017

    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. FA9EEAA8-F49E-465B-9E32-1F857EDDC09E
    FA9EEAA8-F49E-465B-9E32-1F857EDDC09E avatar
    2281 posts
    Member since:
    Jan 2017

    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. FFE3472B-9E09-4977-9CE2-871FA1734668
    FFE3472B-9E09-4977-9CE2-871FA1734668 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. FA9EEAA8-F49E-465B-9E32-1F857EDDC09E
    FA9EEAA8-F49E-465B-9E32-1F857EDDC09E avatar
    2281 posts
    Member since:
    Jan 2017

    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. B92045DB-91FC-47E3-ACA0-E8F487EA365A
    B92045DB-91FC-47E3-ACA0-E8F487EA365A 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. C002BEFC-0EA7-4858-A856-E788F4D4DBFA
    C002BEFC-0EA7-4858-A856-E788F4D4DBFA 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. 408EF643-1F82-4CA5-97D0-3F260D4C501F
    408EF643-1F82-4CA5-97D0-3F260D4C501F 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. FA9EEAA8-F49E-465B-9E32-1F857EDDC09E
    FA9EEAA8-F49E-465B-9E32-1F857EDDC09E avatar
    2281 posts
    Member since:
    Jan 2017

    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

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