Tooltip for DataGrid columns with custom Template

We often use custom templates for the data grid columns, the problem is that by default these columns don't have a tooltip from column value. As I see in the implementation this is because of this line in the datagrid column rendering logic:

var title = column.Template == null && this.ShowCellDataAsTooltip ? $"{column.GetValue(Item)}" : "";

Would you consider modifying the condition, so it still shows the tooltip even if Template is not null. Something like this:

var title = this.ShowCellDataAsTooltip ? $"{column.GetValue(Item)}" : "";

In normal situation when a column cannot get a value, title will be empty string, so everything works as intended, but when a column is linked to a property and has a Template it will have a tooltip.

If we change that it will be a breaking change however we can introduce ShowCellDataAsTooltip property for the column and if set to true the DataGrid will show the tooltip even for template columns.

1 Like

@enchev I checked the changes and I think the condition should be column.Template == null || this.ShowCellDataAsTooltip instead of column.Template == null && this.ShowCellDataAsTooltip.

No, this way we will introduce breaking change. Check my previous reply how we will avoid this - it will be part of our next update before the end of the week.

Oh sorry, I thought you already introduced the changed, my mistake