Search code examples
c#winformsdatagridviewcontextmenustrip

In Winforms, how do you pass the datagridview row right-clicked on to the ContextMenuStrip?


I need to know which row is right-clicked on for the contextMenuStrip in a datagridview. Winforms, c#.


Solution

  • int id = (int)YourGridViewName.SelectedCells[0].Value;