Is there any way to hide a cell's tool tip when it's defined at the column level like so?
When ToolTipValue is null or empty, the tool tip still comes up, just without any content. I'd prefer if it wasn't displayed at all.
4 Answers, 1 is accepted
A similar scenario has been discussed in the following forum thread. Could you please give the suggested approaches a try and let me know if any of them works for you?
I will be looking forward to your reply.
Alternatively, you can also try the approach suggested in this StackOverflow thread.
Neither of those helped. Here's what I had to do for anyone else looking for a solution:
I set the grid view column's cell style like so, so that the cell is not hit test visible when the binding is null or empty, and can therefore not open a tool tip.
Unfortunately, this is quite verbose and must be repeated for every column. At least there's no code behind, but this seems like a lot to have to add to get tool tips to not look ridiculous when empty. Can you think of something a bit more succinct?
Better yet, is there any chance we can get a ToolTipBinding property added to GridViewDataColumn? I currently need 17 lines of xaml to properly set up a tool tip on a cell.
With a ToolTipTemplate property, you can reduce this to a single line for us.
Thank you for sharing your solution with the community.
I see, however, one possible drawback to using such an approach - the cells will no longer be editable.
My best suggestion would be to instead define an implicit style targeting the GridViewDataColumn (please note that this is not recommended in other use-cases) and specify the following ToolTipTemplateSelector for it:
Please note that you can get rid of the NormalTemplate property and dynamically construct the templates based on the item's type.
Please let me know whether using a similar approach would work for you.
I also want to inform you that, as per your request, I've logged a new feature request in our feedback portal regarding a new ToolTipBinding property. If this request generates enough votes, we will consider introducing it in future releases.