Exemplo n.º 1
0
        private void richEditControl1_DragDrop(object sender, DragEventArgs e)
        {
            GridCellData value = (GridCellData)e.Data.GetData(typeof(GridCellData));

            if (value == null)
            {
                return;
            }

            richEditControl1.Document.BeginUpdate();
            richEditControl1.Document.InsertText(richEditControl1.Document.CaretPosition, value.Content);
            richEditControl1.Document.EndUpdate();
            richEditControl1.Options.Behavior.Drop = DevExpress.XtraRichEdit.DocumentCapability.Enabled;
            richEditControl1.Focus();
        }
Exemplo n.º 2
0
        void view_MouseMove(object sender, MouseEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.Button == MouseButtons.Left && downHitInfo != null)
            {
                Size      dragSize = SystemInformation.DragSize;
                Rectangle dragRect = new Rectangle(new Point(downHitInfo.HitPoint.X - dragSize.Width / 2,
                                                             downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize);

                if (!dragRect.Contains(new Point(e.X, e.Y)))
                {
                    string cellTextValue = view.GetDataRow(downHitInfo.RowHandle)[downHitInfo.Column.FieldName].ToString();

                    GridCellData clipboardData = new GridCellData(cellTextValue);
                    view.GridControl.DoDragDrop(clipboardData, DragDropEffects.Move);
                    downHitInfo = null;
                    DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = true;
                }
            }
        }