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

How to get the Row and Column Index of the cell from Mouse Point?

Platform: WPF |
Control: GridControl
Tags: general

In GridControl, you can get the Row and Column Index of a cell under the Mouse Point, by using PointToCellRowColumnIndex and PointToCellRowColumnIndexOutsideCells.

PointToCellRowColumnIndex:

This method allows you to get the Row and Column Index of a cell under the mouse point in GridControl, regardless of its position.

Syntax: PointToCellRowColumnIndex (Point p);

C#

PointToCellRowColumnIndexOutsideCells:

This method allows you to get the Row and Column Index of the cell under the mouse point in GridControl. It also allows you to identify whether you have clicked inside the cell or points outside the cell, that is, Points over the Gridlines.

Syntax: PointToCellRowColumnIndexOutsideCells(Point p, bool allowOutsideLines)

C#

You can easily identify whether you have clicked at any point inside the cell or outside the cell by setting allowOutsideLines as False. It returns negative values for the points that are outside the cell.

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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