Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi.

                                    I am designing a window where I have an ASPxTreeList and an ASPxGridView. Both the tree and the grid are bound to a data source.

                                    I need to drag a node from the tree and drop it on the grid. Then the node text should be displayed at the first column of the grid, before other two columns where I should display predefined text. After drag all the desired nodes to the grid I need to save the data on the grid to its data source. Is it possible? Is there any example available?

                                    Regards,
                                    Rinaldo

                                0

                                Hello Rinaldo,

                                The ASPxTreeList is able to drag nodes from itself to other controls. The main idea of dragging nodes between two treelists is implemented in our Code Central example: How to drag and drop nodes between two ASPxTreeList controls.
                                Unfortunately, we don't have the required example, because we never faced this issue in the past. However, I think that it is possible to drag nodes from the treelist to the grid (not vice versa) via the ASPxClientTreeList.StartDragNode and ASPxClientTreeList.EndDragNode event handlers.

                                Thanks,
                                Vest

                                0

                                Hi Vest.

                                Since I will have to drop the node on the grid, the row must be created at that time. Do you have examples on how to create a row on the gridview programatically?

                                I am tracking a suggestion to implement drag-and-drop on the gridview. Are there any plans to implement it in the near future? We are redesigning an application and we plan to allow the users to do drag-and-drop in many situations.

                                Regards,
                                Rinaldo

                                0

                                Hello Rinaldo,

                                It's possible to implement the required functionality using the following approach:
                                1) Handle the ASPxClientTreeList's StartDragNode event and use the ASPxGridView's main input element as the DraggedNode's target;
                                2) Handle the ASPxClientTreeList's EndDragNode event and perform the ASPxGridView's callback via the ASPxClientGridView's PerformCallback method. Pass the Node's keyValue as a parameter;
                                3) Handle the ASPxGridView's CustomCallback event and use the passed Node's keyValue;
                                4) Remove the data record from the ASPxTreeList's data source using the Node's keyValue;
                                5) Add a new data row to the ASPxGridView data source using the Node's keyValue.

                                I've attached a test project, illustrating how to implement the required functionality.

                                Please take a look at the Examples section of the ASPxClientTreeList.EndDragNode Event topic for more information.

                                Please also take a look at the following thread, which may be helpful in your scenario:
                                Drop ASPxGridView Row to another ASPxTreeList Node

                                See Also:
                                Allow Drag and Drop between Grids

                                Thanks,
                                Mike
                                --------------------
                                Check if Search Engine is able to answer questions faster than I do!
                                --------------------

                                0

                                Hi Mike,

                                thanks for the sample.

                                Maybe I am missing something, but when I run the sample and drop a node on the grid, the row is not created on the grid. Could it be by the fact that I am using the 9.3.5 version of the suite?

                                Regards,
                                Rinaldo

                                0

                                Rinaldo,

                                The attached project only illustrates how to drag ASPxTreeList's node to the ASPxGridView control and perform the ASPxGridView's callback. You can perform steps 3-5 manually. Please refer to the Drop ASPxGridView Row to another ASPxTreeList Node report where I've already implemented the required functionality.

                                Thanks,
                                Mike

                                0

                                C# example.

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners