簡體   English   中英

WPF DataGrid邊框刷不起作用

[英]wpf datagrid border brush not working

我正在努力尋找一種方法來完成這項工作:

<DataGrid x:Name="name" CanUserAddRows="false"
          IsReadOnly="true" ItemsSource="{Binding}">
    <DataGrid.CellStyle>
        <Style TargetType="DataGridCell">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="Red"/>
        </Style>
    </DataGrid.CellStyle>
</DataGrid>

我只想更改單元格邊框的顏色,為什么它必須如此復雜? :/

<DataGrid
    x:Name="name" 
    CanUserAddRows="false"
    IsReadOnly="true" 
    ItemsSource="{Binding}"

    HorizontalGridLinesBrush="DeepSkyBlue"
    VerticalGridLinesBrush="YellowGreen">
</DataGrid>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM