水平垂直线

时间:2022-02-27 19:39:39

Can anyone please tell me how can i disable the listview horizontal and vertical line visibility set to false.like in data grid we use the property gridLine=false.So is there any option for listview?

谁能告诉我如何禁用listview的水平和垂直的可见设置为false。就像在数据网格中一样,我们使用属性gridLine=false。那么listview有什么选项吗?

1 个解决方案

#1


9  

Assuming you're using a ListView with a GridView set as the View, then the ListView doesn't show vertical or horizontal lines by default.

假设您使用的是GridView设置为视图的ListView,那么ListView在默认情况下不会显示垂直或横线。

If you want to add horitzontal lines then you can change the border on the ListViewItem, e.g:

如果你想添加horitzontal线,你可以改变ListViewItem的边框,例如:

<ListView ...>
    <ListView.ItemContainerStyle>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="BorderBrush" Value="LightGray" />
            <Setter Property="BorderThickness" Value="0,0,0,1" />
        </Style>
    </ListView.ItemContainerStyle>
    <ListView.View>
        <GridView>
            <GridViewColumn ... />
        </GridView>
    </ListView.View>
    ...

If you want to add vertical lines then see here for more information.

如果您想添加垂直线,请参见这里获得更多信息。

#1


9  

Assuming you're using a ListView with a GridView set as the View, then the ListView doesn't show vertical or horizontal lines by default.

假设您使用的是GridView设置为视图的ListView,那么ListView在默认情况下不会显示垂直或横线。

If you want to add horitzontal lines then you can change the border on the ListViewItem, e.g:

如果你想添加horitzontal线,你可以改变ListViewItem的边框,例如:

<ListView ...>
    <ListView.ItemContainerStyle>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="BorderBrush" Value="LightGray" />
            <Setter Property="BorderThickness" Value="0,0,0,1" />
        </Style>
    </ListView.ItemContainerStyle>
    <ListView.View>
        <GridView>
            <GridViewColumn ... />
        </GridView>
    </ListView.View>
    ...

If you want to add vertical lines then see here for more information.

如果您想添加垂直线,请参见这里获得更多信息。