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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use the PointToRowCol() method in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 18, 2016 |
Last Revised Date: February 12, 2020

Use of PointToRowCol method

To retrieve the row and column index from the mouse position, the PointToRowCol() method can be used. In the below example, the row, column indices are taken from the mouse down point.

C#

this.gridGroupingControl1.TableControl.MouseDown += TableControl_MouseDown;
 
void TableControl_MouseDown(object sender, MouseEventArgs e)
{
   System.Drawing.Point _Ponto;
   _Ponto = new System.Drawing.Point(e.X, e.Y);
   int row, col;
   gridGroupingControl1.TableControl.PointToRowCol(_Ponto, out row, out col);
   MessageBox.Show("Row :" + row + "\n" + "Col   :" + col);
}

VB

Private Me.gridGroupingControl1.TableControl.MouseDown += AddressOf TableControl_MouseDown
 
Private Sub TableControl_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
   Dim _Ponto As System.Drawing.Point
   _Ponto = New System.Drawing.Point(e.X, e.Y)
   Dim row, col As Integer
   gridGroupingControl1.TableControl.PointToRowCol(_Ponto, row, col)
   MessageBox.Show("Row :" & row + Constants.vbLf & "Col   :" & col)
End Sub

Screenshot

Show the row and column count

Samples:

C#: PointToRowCol

VB: PointToRowCol

2X faster development

The ultimate WinForms 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
Live Chat Icon