Solved

Hover over any cell in row

Posted on 2016-07-18
4
40 Views
Last Modified: 2016-07-20
I'm using the DataGridView.  I want be hover over any cell in a row and display a tooltip.  The data in the tooltip is specific to the row, not the row.  How can I do this?
0
Comment
Question by:HLRosenberger
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:Russ Suter
ID: 41717435
I can probably help you with this but I'm very confused about something in your original question (probably a typo) but I can't figure out what you mean when you wrote
The data in the tooltip is specific to the row, not the row.
Obviously that's a contradictory statement. Can you please clarify what you mean?
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41717620
Sorry.  That's supposed to be:  tooltip is specific to the row, not the cell.
0
 
LVL 20

Accepted Solution

by:
Russ Suter earned 500 total points
ID: 41717641
Gotcha!
All you would need to do is add an event handler to the CellToolTipTextNeeded method of the DataGridView control. Then just set the ToolTipText property as needed. Here's a super simple example:
Private Sub dataGridViewUpwardDependencies_CellToolTipTextNeeded(sender As Object, e As System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs)
	e.ToolTipText = "This is row " + e.RowIndex.ToString()
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 41721200
thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

828 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