Link to home
Start Free TrialLog in
Avatar of Stephen_Perrett
Stephen_Perrett

asked on

Context menu when user right-clicks on row of datagridview

I would like to to know how to go about creating a context menu for a datagridview when the user right-clicks on a row.

I have dragged a ContextMenuStrip from the toolbox and dropped it onto my datagridview and have added a few items.

When I run my application a context menu doesn't appear when I right-click on a populated datagridview row.

Do I need to utilize a datagridview event to make it work?

What do I need to know?

Thanks

Steve
ASKER CERTIFIED SOLUTION
Avatar of newyuppie
newyuppie
Flag of Ecuador image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can do it in the Designer, no need to do it by code.
Avatar of Kinger247
Kinger247

Or

        Dim toolTip As ToolTip = New System.Windows.Forms.ToolTip()
        toolTip.SetToolTip([Your datagridview], "This is the tooltip text")
        toolTip.Active = True

This way you can change the text for individual columns .. on the CellMouseEnter event.
hi kinger, the datagridview columns all have a tooltip property so you wouldnt need to handle it on any event
lol, never spotted that .. ;)
Avatar of Stephen_Perrett

ASKER

Thanks newyuppie for getting me on the right track. Much simpler than I was beginning to imagine.

Also thanks to Kinger247 for your input also.

Steve