Git Product home page Git Product logo

how-to-drag-and-drop-gridcontrol-rows-to-the-treelist-t202760's Introduction

Drag-and-Drop Grid Rows to the TreeList

This example demonstrates how to attach the Drag And Drop Behavior to the TreeList and Grid controls to allow users to move rows from the Grid to the TreeList with the mouse.

In this example:

  • The InitDragDrop() method creates the Behavior Manager and attaches the Drag and Drop Behavior to the TreeList and GridView:

    void InitDragDrop() {
        BehaviorManager behaviorManager1 = new BehaviorManager(this.components);
        behaviorManager1.Attach<DragDropBehavior>(gridView, behavior => {
            behavior.Properties.AllowDrop = false;
            behavior.Properties.InsertIndicatorVisible = true;
            behavior.Properties.PreviewVisible = true;
        });
    
        behaviorManager1.Attach<DragDropBehavior>(treeList, behavior => {
            behavior.Properties.AllowDrop = true;
            behavior.Properties.InsertIndicatorVisible = true;
            behavior.Properties.PreviewVisible = true;
            behavior.DragOver += OnDragOver;
            behavior.DragDrop += OnDragDrop;
        });
    }
  • The bahavior's DragOver and DragDrop events are handled to customize drag-and-drop operations.

Note

A drag-and-drop operation is initiated when a user clicks a row. If there is a cell editor beneath the mouse pointer, it intercepts mouse events and cancels the drag-and-drop operation. To prevent this, the GridView's EditorShowMode property is set to Click.

gridView.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;

Files to Review

Documentation

See Also

how-to-drag-and-drop-gridcontrol-rows-to-the-treelist-t202760's People

Contributors

alexgreenz avatar alexmedusa avatar devexpressexamplebot avatar iam0k avatar lexepox avatar nadezhdadx avatar svetlanapn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.