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; }
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); }
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; } } }
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(); }