我试图在WPF GridView中删除最右边的GridLine.这是一个例子.xaml
<Window x:Class="Pack.ExampleForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Pack"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
Width="400" Height="300">
<DataGrid Margin="5" AutoGenerateColumns="False"
CanUserReorderColumns="False" HeadersVisibility="Column">
<DataGrid.Columns>
<DataGridTextColumn Binding="{x:Null}" CanUserResize="False"/>
<DataGridTextColumn Binding="{Binding Path=Key}" Header="Request Header" Width="*"/>
<DataGridTextColumn Binding="{Binding Path=Value}" Header="Value" Width="*"/>
</DataGrid.Columns>
<local:RequestHeader Key="Subject 1" Value="Body 1" />
<local:RequestHeader Key="Subject 1" Value="Body 1" />
</DataGrid>
</Window>
Run Code Online (Sandbox Code Playgroud)
然而,这有最右边的网格线,如设计师所示,以黄色圈出.
有没有办法删除它并没有边框,因为它在左侧.如果可能的话,更愿意在.xaml中这样做.