Can I freeze the TreeListView Column just like ThemedDataGrid do? If can, how do I accomplish that?
<Style x:Key="PinButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Static themes:SharedResourceKeys.EmbeddedButtonBaseOverrideStyleKey}}">
<Setter Property="Padding" Value="1" />
<Setter Property="ContentTemplate" Value="{DynamicResource {x:Static themes:SharedResourceKeys.UnpinGlyphTemplateKey}}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Column.IsFrozen, RelativeSource={RelativeSource AncestorType={x:Type DataGridColumnHeader}}}" Value="False">
<Setter Property="ContentTemplate" Value="{DynamicResource {x:Static themes:SharedResourceKeys.PinGlyphTemplateKey}}" />
</DataTrigger>
</Style.Triggers>
</Style>
<!-- Header template for columns that includes the "pin" button -->
<DataTemplate x:Key="ColumnHeaderTemplate">
<DockPanel>
<Button DockPanel.Dock="Right" Style="{StaticResource PinButtonStyle}" Margin="3,0,0,0" VerticalAlignment="Center"
Command="{x:Static datagrid:DataGridCommands.ToggleFrozenColumn}"
CommandParameter="{Binding Path=., RelativeSource={RelativeSource AncestorType={x:Type DataGridColumnHeader}}}" />
<TextBlock Text="{Binding}" TextTrimming="CharacterEllipsis" />
</DockPanel>
</DataTemplate>
<datagrid:ThemedDataGrid x:Name="datagrid" AutoGenerateColumns="False" CanUserAddRows="False"
CanUserDeleteRows="False" ItemsSource="{Binding Source={x:Static sampleCommon:SampleData.Values}}"
SelectionUnit="FullRow" GridLinesVisibility="All" FrozenColumnCount="1"
CellStyle="{StaticResource DataGridCellStyleKey}">
<datagrid:ThemedDataGrid.Columns>
<datagrideditors:DataGridInt32Column Binding="{Binding Integer}" Header="Integer"
HeaderTemplate="{StaticResource ColumnHeaderTemplate}" />
<DataGridTextColumn Binding="{Binding String}" Header="String"
HeaderTemplate="{StaticResource ColumnHeaderTemplate}" />
<datagrideditors:DataGridDateColumn Binding="{Binding DateTime}" Header="Date"
HeaderTemplate="{StaticResource ColumnHeaderTemplate}" />
<DataGridCheckBoxColumn Binding="{Binding Boolean}" Header="Boolean"
HeaderTemplate="{StaticResource ColumnHeaderTemplate}" />
<DataGridTextColumn Binding="{Binding LongString}" Header="Long String" />
</datagrid:ThemedDataGrid.Columns>
</datagrid:ThemedDataGrid>
Codes from SampleBrowser/ProductSamples/DataGridSamples/QuickStart/FrozenColumns
[Modified 2 years ago]