How can you show the tooltip for datagridview when cell is selected, not from mouseover but from using the arrow keys?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As you’ve noticed, you won’t be able to use the DataGridView’s built in tooltip. In fact, you will need to disable it so set your DataGridView’s
ShowCellToolTipsproperty tofalse(it’strueby default).You can use the DataGridView’s
CellEnterevent with a regular Winform ToolTip control to display tool tips as the focus changes from cell to cell regardless of whether this was done with the mouse or the arrow keys.Note that I added an offset to the location of the ToolTip based on the cell’s height and width. I did this so the ToolTip doesn’t appear directy over the cell; you might want to tweak this setting.