dngchn's [WPF]2017. 9. 1. 15:11

ListView의 컬럼 사이즈 조정을 사용자가 하지 못하도록 막자.


<ListView x:Name="AlarmListView" Margin="0,0,0,8" ItemsSource="{Binding AlarmCollection}" HorizontalAlignment="Stretch">
    <ListView.View>
        <GridView>
            <GridView.ColumnHeaderContainerStyle>
                <Style BasedOn="{StaticResource {x:Type GridViewColumnHeader}}" TargetType="{x:Type GridViewColumnHeader}">
                    <Setter Property="IsHitTestVisible" Value="False"/>
                </Style>
          </GridView.ColumnHeaderContainerStyle>                                       
            <GridViewColumn Header="Message" DisplayMemberBinding="{Binding Message}" />
        </GridView>
    </ListView.View>
</ListView>


위와 같이 IsHitTestVisible을 false로 하면 됨.

Posted by dngchn