Here is the original DataGridTextColumn definition...
<DataGridTextColumn Header="Total Pending" Width="60" Binding="{Binding Path=TotalQuantityPending, StringFormat=0.00;;#}" ElementStyle="{StaticResource TextBlockRightAlign}" IsReadOnly="true">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCell}">
<Setter Property="ToolTip">
<Setter.Value>
<MultiBinding Converter="{StaticResource ConversionConverter}">
<Binding Path="UORCode"/>
<Binding Path="UOICode"/>
<Binding Path="Conversion"/>
<Binding Path="TotalQuantityReturned"/>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
Now to add a static tooltip to the header we take advantage of the fact that the header can be any content control. So we make it a textblock with it's own tooltip. Simple when you think of it.
<DataGridTextColumn Width="60" Binding="{Binding Path=TotalQuantityPending, StringFormat=0.00;;#}" ElementStyle="{StaticResource TextBlockRightAlign}" IsReadOnly="true">
<DataGridTextColumn.Header>
<TextBlock Text="Total Pending" ToolTip="Total received on this line on all Pending receipts."></TextBlock>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCell}">
<Setter Property="ToolTip">
<Setter.Value>
<MultiBinding Converter="{StaticResource ConversionConverter}">
<Binding Path="UORCode"/>
<Binding Path="UOICode"/>
<Binding Path="Conversion"/>
<Binding Path="TotalQuantityReturned"/>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn.Header>
<TextBlock Text="Total Pending" ToolTip="Total received on this line on all Pending receipts."></TextBlock>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCell}">
<Setter Property="ToolTip">
<Setter.Value>
<MultiBinding Converter="{StaticResource ConversionConverter}">
<Binding Path="UORCode"/>
<Binding Path="UOICode"/>
<Binding Path="Conversion"/>
<Binding Path="TotalQuantityReturned"/>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
No comments:
Post a Comment