在WPF中的Datagrid中克隆数据 [英] Clone a data in Datagrid in WPF

查看:132
本文介绍了在WPF中的Datagrid中克隆数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在wpf中克隆一行DataGrid,即:在运行时我将选择一行并添加一个按钮,该按钮在datagrid中添加一个新行,并且具有与所选行相同的值。



请帮我实现这个功能。如果需要更多说明,请告诉我。



谢谢

I want to clone a row of DataGrid in wpf i.e: on run time I will select a row and add a button which add a new row in datagrid and will have the same values which the selected row had.

Please help me achieving this functionally. Please let me know if more clarification is required.

Thanks

推荐答案

分配第一个数据源datagrid到第二个数据网格。

这样你将有两个显示相同数据的网格。
Assign the datasource of the first datagrid to the second datagrid.
This way you will have two grids displaying the same data.


这篇关于在WPF中的Datagrid中克隆数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆