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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MouseDown event and absolute column/row

Thread ID:





8575 Nov 12,2003 03:56 PM UTC Nov 12,2003 05:53 PM UTC WinForms 1
Tags: GridControl
Eric Demers
Asked On November 12, 2003 03:56 PM UTC

Hi, I'm trying to figure out how to get the absolute Row/Column in the Grid.MouseDown event. I can get the visible Row/Column, but I NEED the absolute Row/Column. Is there a way to get this information without going into the CellMouseDown event? The problem I have with using the CellMouseDownEvent, is that I do not want the user to actually get into the cell, but it's too late at that time, as the cell is being changed to the Edit mode. Maybe I'm not using the right events to deal with that issue! Please help!

Administrator [Syncfusion]
Replied On November 12, 2003 05:53 PM UTC

You can get the row and col with code like this.
private void gridControl1_MouseDown(object sender, MouseEventArgs e)
	int row, col;
	if(this.gridControl1.PointToRowCol(new Point(e.X, e.Y), out row, out col, -1))
		Console.WriteLine(row.ToString() + "  " + col.ToString())
But if you want to prevent the currentcell from moving with a click, you might try setting e.Cancel = true in CurrentCellMoving.
private void gridControl1_CurrentCellMoving(object sender, 
	GridCurrentCellMovingEventArgs e)
	if(e.ColIndex == 3)
		e.Cancel = true;


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon