Display a ToolTip for a DataGrid Cell


/ Published in: C#
Save to your folder(s)

Weird issue with Intellisense and the HitTestInfo class. Just type it in, it will compile.


Copy this code and paste it in your HTML
  1. private void dataGrid1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
  2. {
  3. try
  4. {
  5. DataGrid.HitTestInfo hti = dataGrid1.HitTest(e.X,e.Y);
  6. if(hti.Type == DataGrid.HitTestType.Cell)
  7. {
  8. toolTip1.SetToolTip(dataGrid1, dataGrid1[hti.Row, hti.Column].ToString());
  9. }
  10. }
  11. catch{}
  12. }

URL: http://msdn2.microsoft.com/en-us/library/ms996485.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.