【问题标题】:Copy doesn't work on DataGrid templated columns?复制不适用于 DataGrid 模板列?
【发布时间】:2011-04-02 20:55:53
【问题描述】:

在 WPF 数据网格中使用模板列时,您无法再复制单元格内容,有谁知道如何解决这个问题?

【问题讨论】:

    标签: wpf datagrid copy


    【解决方案1】:

    需要将ClipboardContentBinding属性设置为row item中想要的属性,见如下代码:

    <DataGrid>
            <DataGrid.Columns>
                <DataGridTemplateColumn ClipboardContentBinding="{Binding YouProperty}">
    
                </DataGridTemplateColumn>
            </DataGrid.Columns>
    </DataGrid>
    

    【讨论】:

    • 如果我们希望 Grid 中的文本框也一样
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-06
    • 2021-08-22
    • 2013-01-05
    • 2021-07-26
    • 2015-07-23
    • 2013-01-07
    相关资源
    最近更新 更多