Home Forums WinForms controls Xceed Grid for WinForms MouseEvents: Issue with X Y coord’s

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #12686 |

    My issue seems simple. I add a mouse even to a columns cells. Like so:

    foreach (Xceed.Grid.DataRow grow in gridRevenueTab.DataRows)
    foreach (Xceed.Grid.Cell gcell in grow.Cells)
    if (gcell.ParentColumn == gridRevenueTab.Columns[“Description”])
    gcell.MouseDown += new System.Windows.Forms.MouseEventHandler(this.DescCell_MouseDown);

    Now in that procedure, DescCell_MouseDown I detect the right click event. And attempt to display a context menu at the mouse location. Problem is, the X and Y coord’s are based off the cell, not the cell’s location in the grid.

    How, if it’s possible, can I detect the location of the cell in the grid and display the context menu accordingly.


    Imported from legacy forums. Posted by Buggi (had 2387 views)

    Xceed Support
    Post count: 5658

    Hi Buggi,

    You can use the ClientPointToGrid method which will convert the location of the specified client point into grid coordinates. This method is available on every VisualGridElement.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 3656 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.