WPF : Extend last column of ListView's GridView

前端 未结 7 635
北海茫月
北海茫月 2020-11-28 06:50

I have a ListView with a GridView with 3 columns. I want last column to take up remaining width of the ListView.

相关标签:
7条回答
  • 2020-11-28 07:52

    I used Pale Ales's suggestion with a minor change:

    <Style x:Key="GridViewExtraStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="Foreground" Value="{x:Null}"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
    </Style>
    
    <ListView>
        <ListView.View>
            <GridView ColumnHeaderContainerStyle="{DynamicResource GridViewExtraStyle}">
                <GridViewColumn Header="Abc" Width="{Binding Path=mywidth}"/>
            </GridView>
        </ListView.View>
    </ListView>
    
    0 讨论(0)
提交回复
热议问题