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
This behavior is ubiquitous in grid-like UI elements throughout Windows OS and other software. Text trimming is a strong UX feature; it communicates to the user that they are not viewing the entire block of text. A tooltip makes it easy to see that full text without adjusting the UI control, which may be difficult or impossible if resizing is disabled.
Many Windows programs have this proposed behavior. Examples in Windows 10 are File Explorer (details view) and Task Manager (Details or Services tab).
There are ways to implement this currently, but neither are very robust. Because DataGridTextColumn does not derive from FrameworkElement, it is not possible to use a style. Could use a DataGridTemplateColumn, but then you have the challenge of recreating the text template that DataGridTextColumn already provides.
Implementation details
These details are based on my experience with the proposed behavior.
The text trimming employed is CharacterEllipsis, as defined by TextTrimming.CharacterEllipsis.
The tooltip is enabled only when the text is trimmed.
If trimmed it should display the tooltip automatically. I dont think we need a separate option for that. If for some reasons a dev does not want this behavior then he can simply override it.
It depends on the application scenario (Excel for example doesn't do that) and trimming has non-trivial performance impact, so I would be cautious with a default behavior.
Also note that there isn't an easily accessible way to find out whether a TextBlock is trimmed or not, but it would be useful to add that.
DataGridTextColumn
should have an attribute that enables text trimming and provides a dynamic tooltip. Example:Motivation
This behavior is ubiquitous in grid-like UI elements throughout Windows OS and other software. Text trimming is a strong UX feature; it communicates to the user that they are not viewing the entire block of text. A tooltip makes it easy to see that full text without adjusting the UI control, which may be difficult or impossible if resizing is disabled.
Many Windows programs have this proposed behavior. Examples in Windows 10 are File Explorer (details view) and Task Manager (Details or Services tab).
There are ways to implement this currently, but neither are very robust. Because
DataGridTextColumn
does not derive fromFrameworkElement
, it is not possible to use a style. Could use aDataGridTemplateColumn
, but then you have the challenge of recreating the text template thatDataGridTextColumn
already provides.Implementation details
These details are based on my experience with the proposed behavior.
TextTrimming.CharacterEllipsis
.Alternatives
The text was updated successfully, but these errors were encountered: