You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add ability to set tooltip for column header to FluentDataGrid #2757
I'd like to set a tooltip for a column header that is different from Title, but it seems impossible at the moment.
💁 Possible Solution
I tried to override HeaderCellItemTemplate, but generated code misses a necessary attribute:
That autogenerated attribute that applies the necessary styling is missing when setting HeaderCellItemTemplate as
Turns out we can't do it in the way I suggested. When rendering the headers, we do not have an actual item available yet that can act as the context for getting the TooltipText function executed,
Activity
vnbaaij commentedon Oct 4, 2024
In determining what tooltip to show in the header, the following code is now used:
(in
ColumnBase.razor, right above where your<div...code comes from.What if we change that to:
That way you could use the
TooltipTextparameter to change the tooltip text even with the standard header template.ps: In your HeaderCellItemTemplate, I think you should be able to get that attribute added by using
::deepin your own stylesFix #2757 by using TooltipText if set (instead of always using Title)
vnbaaij commentedon Oct 7, 2024
Turns out we can't do it in the way I suggested. When rendering the headers, we do not have an actual item available yet that can act as the context for getting the
TooltipTextfunction executed,vnbaaij commentedon Oct 7, 2024
Creating a new PR for this. We have now solved this by adding a new
HeaderTooltipparameter to the column:[DataGrid] Add `HeaderTootip` to columns to allow for custom header t…