We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

selecting a row from mouse position

Thread ID:





69472 Oct 29,2007 02:26 PM Oct 29,2007 07:06 PM Windows Forms 1
Tags: GridControl
Asked On October 29, 2007 02:26 PM

I'm trying to select a row based on the mouse position. How to I know which row the mouse pointer is on from a the mouse coordiantes in the MouseEventArgs?


haneefm [Syncfusion]
Replied On October 29, 2007 07:06 PM

Hi Shariff,

You could determine the rowindex of the grid using the grid.PointToRowCol() method in the MouseDown event of the grid.

int row, col;
void gridControl1_MouseDown(object sender, MouseEventArgs e)
Point pt = new Point(e.X, e.Y);
this.gridControl1.PointToRowCol(pt, out row, out col);
Console.WriteLine("RowIndex: {0}", row);

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.