Ejemplo n.º 1
0
        private void OnDragDropMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            //Start drag\drop if user is dragging
            DataObject oData = null;

            try {
                switch (e.Button)
                {
                case MouseButtons.Left:
                    UltraGrid oGrid = (UltraGrid)sender;
                    if (this.mIsDragging)
                    {
                        //Initiate drag drop operation from the grid source
                        if (oGrid.Focused && oGrid.Selected.Rows.Count > 0)
                        {
                            oData = new DataObject();
                            oData.SetData("");
                            DragDropEffects effect = oGrid.DoDragDrop(oData, DragDropEffects.All);
                            this.mIsDragging = false;

                            //After the drop- handled by drop code
                            switch (effect)
                            {
                            case DragDropEffects.Move: break;

                            case DragDropEffects.Copy: break;
                            }
                        }
                    }
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
        }