【问题标题】:How can I make a template column of WPF Toolkit's DataGrid sortable?如何使 WPF Toolkit 的 DataGrid 的模板列可排序?
【发布时间】:2010-11-15 07:58:54
【问题描述】:

我的应用程序使用 WPF 工具包的DataGrid。标准列标题是可点击的(当我用鼠标移动它们时,也会出现一些效果),但模板列的标题没有这种行为。当我单击标题时,不会触发排序事件,也没有视觉效果。

<Controls:DataGrid Sorting="DataGrid_Sorting">
    <Controls:DataGrid.Columns>
        <Controls:DataGridTextColumn Header="Hello" />
        <Controls:DataGridTemplateColumn Header="World">
            <Controls:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Button Content="Test" />
                </DataTemplate>
            </Controls:DataGridTemplateColumn.CellTemplate>
        </Controls:DataGridTemplateColumn>
    </Controls:DataGrid.Columns>
</Controls:DataGrid>

如何实现排序(或者我需要向DataGrid 提供哪些信息)?

最好的问候,奥利弗·哈纳皮

【问题讨论】:

    标签: wpf sorting datagrid wpftoolkit


    【解决方案1】:

    我在 CodePlex 上找到了解决方案:http://wpf.codeplex.com/Thread/View.aspx?ThreadId=63961

    最好的问候
    奥利弗·哈纳皮

    【讨论】:

    • 在这里发布一个解决方案的小例子也会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-31
    • 1970-01-01
    • 1970-01-01
    • 2010-11-08
    • 2010-12-15
    • 2012-11-04
    相关资源
    最近更新 更多