如何在 WPF DataGrid 中显示小指针,就像在 WinForms DataGridView 中一样

本文关键字:WinForms DataGridView 一样 DataGrid WPF 显示 小指 指针 | 更新日期: 2023-09-27 18:36:33

我正在研究WPF和DataGrids,我对此非常陌生。我需要 WPF DataGrid 在其行标题中显示小指针,就像在 WindowsForms DataGridView 中所做的那样(它看起来像一个指向右侧的小三角形)。

我已经尝试过此属性:

dataGrid1.HeadersVisibility = DataGridHeadersVisibility.All;

但是按照上面所做的dataGrid得到了一些非常小的标题,这似乎只是为了选择整行。

我对此做了一些研究,但我一无所获。

有谁知道这是否可能?

提前谢谢你。

如何在 WPF DataGrid 中显示小指针,就像在 WinForms DataGridView 中一样

2件事

--

1) 指定一个 SortMemberPath -- 这将为你提供默认样式 2) 设置网格标题模板的样式

经过一些研究,我发现了两个链接,可以让我做我想要完成的事情:

WPF 数据网格行指示器

或者这个:

更改 DataGrid 控件的选定行的样式