示例#1
0
        private void layoutView_MouseMove(object sender, MouseEventArgs e)
        {
            LayoutView view = sender as LayoutView;

            LayoutViewHitInfo info = view.CalcHitInfo(new Point(e.X, e.Y));

            HoverCard = info.HitCard;
        }
示例#2
0
        private void gridControl1_DragDrop(object sender, DragEventArgs e)
        {
            GridControl       grid        = sender as GridControl;
            LayoutView        view        = grid.MainView as LayoutView;
            LayoutViewHitInfo downHitInfo = e.Data.GetData(typeof(LayoutViewHitInfo)) as LayoutViewHitInfo;
            LayoutViewHitInfo hitInfo     = view.CalcHitInfo(grid.PointToClient(new Point(e.X, e.Y)));
            int sourceRow = downHitInfo.RowHandle;
            int targetRow = hitInfo.RowHandle;

            MoveRow(sourceRow, targetRow);
        }
示例#3
0
        private void gridControl1_DragOver(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.None;

            LayoutViewHitInfo downHitInfo = e.Data.GetData(typeof(LayoutViewHitInfo)) as LayoutViewHitInfo;

            if (downHitInfo != null)
            {
                GridControl       grid    = sender as GridControl;
                LayoutView        view    = grid.MainView as LayoutView;
                LayoutViewHitInfo hitInfo = view.CalcHitInfo(grid.PointToClient(new Point(e.X, e.Y)));
                if (hitInfo.InCard && hitInfo.RowHandle != downHitInfo.RowHandle)
                {
                    e.Effect = DragDropEffects.Move;
                }
            }
        }
示例#4
0
        private void layoutView1_MouseDown(object sender, MouseEventArgs e)
        {
            LayoutView view = sender as LayoutView;

            downHitInfo = null;

            LayoutViewHitInfo hitInfo = view.CalcHitInfo(new Point(e.X, e.Y));

            if (Control.ModifierKeys != Keys.None)
            {
                return;
            }
            if (e.Button == MouseButtons.Left && hitInfo.InCard)
            {
                downHitInfo = hitInfo;
            }
            GetPicture();
        }