wpf - 删除 DataGrid 单元格虚线边框?

标签 wpf datagrid border

enter image description here

我想删除在上面的数据网格单元中可以看到的浪漫周围的虚线边框。每当我使用键盘左右导航键时,就会出现边框。我怎样才能摆脱它?

最佳答案

您必须清除 DataGridCells 的 FocusVisualStyle

<DataGrid>
    <DataGrid.CellStyle>
        <Style TargetType="{x:Type DataGridCell}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        </Style>
    </DataGrid.CellStyle>
...

关于wpf - 删除 DataGrid 单元格虚线边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8261465/

相关文章:

wpf - MVVM组合框 ListView 中的选定项绑定(bind)

c# - 为什么 ObservableCollection 隐藏 INotifyPropertyChanged.PropertyChanged

c# - 使用 TestStack.White 进行测试时如何操作 DataGrid 值?

WPF TextBlock 字体大小调整以填充网格中的可用空间

c# - WPF缩放 Canvas 在鼠标位置上居中

wpf - DataGrid 项的静默更新

c# - 在 C# Windows 应用程序中设置 Datagrid 的单元格宽度

android - 如何在 Android TextView 周围放置边框?

html - 边框转到上面的 div 的奇怪问题?

cocoa - NSBezierPath 描边颜色错误