Currently I need format the tooltip string in data cell column type DataGridTextColumn
Here is my try:
<DataGrid.Columns>
<DataGridTextColumn Header ="Count Number">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip"
Value="{Binding CountNumber, StringFormat={}{0:00}}">
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.Binding>
<Binding Path="CountNumber" StringFormat="{}{0:00}" UpdateSourceTrigger="PropertyChanged" />
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<!-- other columns-->
</DataGrid.Columns>
I also tried:
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CountNumber}"/>
<Setter Property="ToolTip.ContentStringFormat" Value="{}{0:00}"/>
</Style>
</DataGridTextColumn.CellStyle>
But both them don't work.
For example, the number 3 should be display as 03. Is there any idea?