Click here to Skip to main content
15,913,263 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have to show few details in datagrid's tooltip dynamically as the mouse hover on the particular row. I am not using datagridview.
I am getting the dataonly when clicking on the particular row of the grid as focus of the desired row get sets. But i need the same without clicking on the grid and just on mouse pointer over it.

Please suggest if have any solution.

Note: I had found solutions for ASP.Net over net but not for WinForms.. and my project is of WinForms only.


Regards,

honeyashu
Posted
Updated 1-May-11 22:14pm
v2

1 solution

This is exactly how ToolTip is designed — it works on mouse hover; and a control does not matter. However, you can use additional events specific to the control to modify a ToolTip text. The usage of it not completely intuitive; one unusual thing is that one ToolTip instance works for multiple control.

The code sample of this MSDM page is good enough to start:
http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx[^].

—SA
 
Share this answer
 
v2
Comments
honeyashu 29-Apr-11 3:49am    
SaKryukov,
thanks for your reply, but the problem i am facing is getting the pointed row of the datagrid..
I need the help for datagrid. :)
Sergey Alexandrovich Kryukov 29-Apr-11 4:00am    
I see. The additional event you need would be MouseMove (unfortunately). You will need to find out how to locate individual row by mouse coordinate and certainly the scroll bar position. Well, for help on Data Grid, read MSDN help on Data Grid...
--SA
honeyashu 29-Apr-11 6:49am    
Tried but no clue :(
Sergey Alexandrovich Kryukov 29-Apr-11 10:54am    
Did you run event handler(s) under debugger? "No clue" does not describe the issue. Not firing, not showing tooltip..?
--SA
honeyashu 1-May-11 23:15pm    
Yeah i did.. but unable to select the desired row on mouse hover over the grid.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900