Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
Sorting a XamGrid column
posted

Hi,

I have a custom column that has an image for it's header and item template

<DataTemplate x:Key="NameTemplate" DataType="local:GridItemViewModelBase">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Icon}" Width="16" Height="16" Margin="5,0,0,0" />
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding DisplayName}" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>


<DataTemplate x:Key="PublishIconHeaderTemplate" DataType="local:GridItemViewModelBase">
<StackPanel Orientation="Horizontal">
<Image Source="pack://application:,,,/Application.Resource;component/Images/Commands/Sync/Publish_16x16.png" Visibility="Visible" Width="16" Height="16"/>
</StackPanel>
</DataTemplate>

The column can be. Is there a way to hide the arrow button when it is sorted but I can still sort the column by clicking on the header icon?

In this pic: 

https://ibb.co/dk5QNk

The highlighted arrow will not be shown (sorted or not -- so I only have the icon contained in the column (no extra spaces)), but when I click on the icon itself, I can still sort the column.

Thanks!