/// <summary> /// /// </summary> /// <param name="grid"></param> /// <param name="x"></param> /// <param name="y"></param> /// <returns></returns> public static GridEXRow GetRow(this GridEX grid, int x, int y) { GridArea area = grid.HitTest(x, y); if (area != GridArea.Cell) { return(null); } int position = grid.RowPositionFromPoint(x, y); return(grid.GetRow(position)); }
private void mGrid_MouseDown(object sender, MouseEventArgs e) { if ((e.Button & System.Windows.Forms.MouseButtons.Left) != 0) { var hitTest = mGrid.HitTest(e.X, e.Y); if (hitTest == Janus.Windows.GridEX.GridArea.Cell) { // this is a row of some kind! var dragSize = SystemInformation.DragSize; dragDropRectangle = new Rectangle(new Point(e.X - (dragSize.Width / 2), e.Y - (dragSize.Height / 2)), dragSize); dragDropStartPoint = new Point(e.X, e.Y); } else { dragDropRectangle = Rectangle.Empty; } } else { dragDropRectangle = Rectangle.Empty; } }