How does one hittest for a cell using X,Y from grid_mousedown event?
I thought GridRangeInfo.FromTlhw(y,x,0,0) would do, but, the GridRangeInfo object it returns has X as the Left and Y as the Top, not the actual cell row /column index.
I Don't think I can use CellMouseDown event, because I'm trying to find for disabled, read-only cells. Haven't actually tried... however, I'd still be interested in knowing how to find acell based on grid's X,Y coordinates.
ADAdministrator Syncfusion Team August 14, 2003 01:39 PM
Is this what you needed?
Private Sub gridControl1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Sub gridControl1.MouseDown
If e.Button = MouseButtons.Right Then
dim rowIndex, colIndex as Integer
Me.gridControl1.PointToRowCol(New Point(e.X, e.Y), rowIndex, colIndex)
Console.WriteLine(rowIndex.ToString() + " " + colIndex.ToString())
private void gridControl1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
if(e.Button == MouseButtons.Right)
int row, col;
if(this.gridControl1.PointToRowCol(new Point(e.X, e.Y), out row, out col, -1))
Console.WriteLine(row.ToString() + " " + col.ToString())
ERERobishawAugust 14, 2003 03:47 PM
What is GridRangeInfo.FromTlhw(y,x,...) used for?
ADAdministrator Syncfusion Team August 14, 2003 04:17 PM
It is just a static method that takes top, left, height,width and returns a GridRangeInfo object based on these entires. The 'normal' GridRangeInfo.Cells static method takes top, left, bottom, right.