Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 65
  • Last Modified:

Hover over any cell in row

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
HLRosenberger
Asked:
HLRosenberger
  • 2
  • 2
1 Solution
 
Russ SuterCommented:
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
 
HLRosenbergerAuthor Commented:
Sorry.  That's supposed to be:  tooltip is specific to the row, not the cell.
0
 
Russ SuterCommented:
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
 
HLRosenbergerAuthor Commented:
thanks.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now