BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
if (e.Column.MappingName == "Value"){e.Column.ToolTipTemplateSelector = new ToolTipTemplateSelector();e.Column.ShowToolTip = true;
}
public class ToolTipTemplateSelector : DataTemplateSelector{public override DataTemplate SelectTemplate(object item, DependencyObject container){if (item == null || container == null)return base.SelectTemplate(item, container);FrameworkElementFactory factory = new FrameworkElementFactory(typeof(TextBlock));factory.SetBinding(TextBlock.TextProperty, new Binding("Comment") { UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged });return new DataTemplate { VisualTree = factory };}}
if (e.Column.MappingName == "Value")
{
e.Column.ToolTipTemplateSelector = new ToolTipTemplateSelector();
e.Column.ShowToolTip = true;
DataTemplate style = Application.Current.FindResource("GridCellStyle1") as DataTemplate;
e.Column.CellTemplate = style;
} |
<DataTemplate x:Key="GridCellStyle1">
<StackPanel>
<Border
Width="10"
Height="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
SnapsToDevicePixels="True"
Visibility="{Binding Converter={StaticResource visibiltiyconverter}}">
<Path Data="F1 M 0.500,5.574 L 0.500,9.324 L 4.333,12.823 L 6.000,12.823 L 13.583,4.907 L 13.583,1.241 L 6.000,9.116 L 4.292,9.157 L 0.500,5.574 Z"
Fill="Green"
SnapsToDevicePixels="True"
Stretch="Fill" />
</Border>
<TextBlock HorizontalAlignment="Center" Text="{Binding Path=Value}">
</TextBlock>
</StackPanel>
</DataTemplate> |