WPF DataGrid 默认显示行号

xml 复制代码
<DataGrid
    Name="DataGrid"
    Grid.Row="1"
    Margin="10"
    hc:DataGridAttach.ShowRowNumber="True"
    Background="{StaticResource SecondaryBackground}"
    BorderThickness="1"
    CanUserSortColumns="True"
    IsReadOnly="True"
    ItemsSource="{Binding DeviceDataList}"
    SelectionMode="Single"
    Style="{StaticResource CenterDataGridStyle}"
    VerticalScrollBarVisibility="Visible">

主要是这两个属性
HeadersVisibility="Row"(不要这个属性)

hc:DataGridAttach.ShowRowNumber="True"

相关推荐
没有bug.的程序员2 天前
SOA、微服务、分布式系统的区别与联系
java·jvm·微服务·架构·wpf·日志·gc
Macbethad2 天前
基于WPF的半导体设备配方管理程序技术方案
wpf
FuckPatience2 天前
WPF Geometry
wpf
武藤一雄3 天前
.NET 中常见计时器大全
microsoft·微软·c#·.net·wpf·.netcore
MarkHD3 天前
车辆TBOX科普 第70次 AUTOSAR Adaptive、容器化与云原生的融合革命
云原生·wpf
极客智造3 天前
WPF Behavior 实战:自定义 InvokeCommandAction 实现事件与命令解耦
wpf
L、2183 天前
Flutter 与 OpenHarmony 深度集成:构建分布式多端协同应用
分布式·flutter·wpf
布伦鸽3 天前
C# WPF -MaterialDesignTheme 找不到资源“xxx“问题记录
开发语言·c#·wpf
小二·3 天前
MyBatis基础入门《十五》分布式事务实战:Seata + MyBatis 实现跨服务数据一致性
分布式·wpf·mybatis
helloworddm4 天前
UnregisterManyAsync
wpf