简体   繁体   English

修改另一个单元格时更新WPF datagrid单元格值

[英]Update WPF datagrid cell value when another cell is modifed

I have a DataGrid bound to a DataView . 我有一个DataGrid绑定到DataView One of the fields is a last update time stamp. 字段之一是最后更新时间戳。 Is it possible to have this field update with the current date and time if 1 of 5 selected other fields on a given row is modified? 如果修改给定行中的5个其他选定字段中的1个,是否可以使用当前日期和时间更新此字段?

Thanks 谢谢

When you do the actual save to the database is when you should update the update field using either DateTime.Now or DateTime.UTCNow . 进行实际保存到数据库时,应该使用DateTime.Now or DateTime.UTCNow更新更新字段。

Look at this questions as well, What is the best way to know if the user has changed data in the DataGrid? 还要看看这个问题, 什么是最好的方法来知道用户是否更改了DataGrid中的数据? .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM