?
Solved

Context menu when user right-clicks on row of datagridview

Posted on 2006-11-01
6
Medium Priority
?
4,536 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:Stephen_Perrett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 2000 total points
ID: 17854419
you need to set the ContextMenu property of the DataGridView to your created ContextMenuStrip.
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17854425
you can do it in the Designer, no need to do it by code.
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17854449
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:newyuppie
ID: 17854460
hi kinger, the datagridview columns all have a tooltip property so you wouldnt need to handle it on any event
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17854483
lol, never spotted that .. ;)
0
 
LVL 11

Author Comment

by:Stephen_Perrett
ID: 17854504
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

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question