I have an application with a lot of ListView
controls using the GridView
layout. All of these use a custom Style
customStyle
. I want to disable column reordering in all of these ListView
controls.
Can I do this without touching all of the controls using the existing Style? I tried this, but it doesn't seem to work:
<Style x:Key="customStyle"
BasedOn="{StaticResource ResourceKey={x:Type ListView}}"
TargetType="{x:Type ListView}">
<Setter Property="GridView.AllowsColumnReorder" Value="False" />
...
</Style>
Thanks!
Update: If this is not possible, is there a way to disable the column reordering by default in my application?
Update:
I also tried this, which doesn't work. Probably because GridView doesn't have a Style
property.
<Style TargetType="{x:Type GridView}">
<Setter Property="AllowsColumnReorder" Value="False" />
...
</Style>