【问题标题】:How to show the Small Pointer in WPF DataGrid as in WinForms DataGridView如何像在 WinForms DataGridView 中一样在 WPF DataGrid 中显示小指针
【发布时间】:2012-06-11 19:22:12
【问题描述】:

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

我已经尝试过这个属性:

dataGrid1.HeadersVisibility = DataGridHeadersVisibility.All;

但是如上所述,dataGrid 得到了一些非常小的标题,似乎只是为了选择整行。

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

有人知道这是否可能吗?

提前谢谢你。

【问题讨论】:

    标签: c# wpf wpfdatagrid


    【解决方案1】:

    两件事--

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

    【讨论】:

      【解决方案2】:

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

      WPF DataGrid Row indicators

      或者这个:

      Changing the style of the selected row of the DataGrid control

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-17
        • 2015-01-12
        • 1970-01-01
        • 1970-01-01
        • 2018-03-03
        • 2012-01-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多