ScrollTipContentTemplateSelector Property
Gets or sets a
DataTemplateSelector that provides a way to apply a different
scroll-tip content template based on custom logic.
Property Value
A reference to a
DataTemplateSelector that provides a way to apply a different
scroll-tip content template based on custom logic.
All examples in this topic assume that the grid is bound to the
Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to display a scroll tip whose content and location have been modified.
The flagConverter resource represents a converter that is used to return the appropriate BitmapImage according to the value of the ShipCountry cell.
<Grid>
<Grid.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
Source="{Binding Source={x:Static Application.Current},
Path=Orders}"
AutoCreateItemProperties="False">
<xcdg:DataGridCollectionViewSource.ItemProperties>
<xcdg:DataGridItemProperty Name="ShipCountry"/>
<xcdg:DataGridItemProperty Name="ShipCity"/>
<xcdg:DataGridItemProperty Name="ShipAddress"/>
<xcdg:DataGridItemProperty Name="ShipPostalCode"/>
<xcdg:DataGridItemProperty Name="ShipName"/>
<xcdg:DataGridItemProperty Name="OrderDate"/>
<xcdg:DataGridItemProperty Name="ShippedDate"/>
<xcdg:DataGridItemProperty Name="Freight"/>
</xcdg:DataGridCollectionViewSource.ItemProperties>
</xcdg:DataGridCollectionViewSource>
<local:FlagPathConverter x:Key="flagConverter"/>
<Style TargetType="{x:Type xcdg:ScrollTip}">
<Setter Property="HorizontalAlignment"
Value="Center"/>
<Setter Property="VerticalAlignment"
Value="Center"/>
<Setter Property="Width"
Value="150"/>
<Setter Property="Height"
Value="125"/>
</Style>
</Grid.Resources>
<xcdg:DataGridControl x:Name="OrdersGrid"
ItemsSource="{Binding Source={StaticResource cvs_orders}}">
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="ShipCountry"
IsMainColumn="True">
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<Image Source="{Binding Converter={StaticResource flagConverter}}"
StretchDirection="DownOnly"/>
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
</xcdg:DataGridControl.Columns>
<xcdg:DataGridControl.View>
<xcdg:TableView ShowScrollTip="True">
<xcdg:TableView.ScrollTipContentTemplate>
<DataTemplate>
<Grid>
<Image Source="{Binding Path=[ShipCountry], Converter={StaticResource flagConverter}}"/>
<TextBlock Text="{Binding Path=[ShipCountry]}"
FontSize="14"
FontWeight="UltraBold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</DataTemplate>
</xcdg:TableView.ScrollTipContentTemplate>
</xcdg:TableView>
</xcdg:DataGridControl.View>
</xcdg:DataGridControl>
</Grid>
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.