在WPF DataGrid中更新 [英] update in WPF DataGrid

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

问题描述

我无法获取DataGrid当前单元格的新值

I can''t get the new value of the current cell of a DataGrid

private void dgBTLigne_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            MessageBox.Show((dgBTLigne.SelectedItem as BTLigneDTO).Sujet);
        }


我总是得到旧值.


I always get the old value.

推荐答案

数据绑定是解决之道.

http://www.nbdtech.com/Free/WpfBinding.pdf 上有WPF数据绑定备忘单. [ ^ ]

您还可以阅读以下CodeProject文章:

WPF数据绑定-第1部分 [ WPF导览–第3部分(数据绑定) [
Data binding is the way to go.

There is a WPF data binding cheat sheet at http://www.nbdtech.com/Free/WpfBinding.pdf[^]

You sould also read these CodeProject articles:

WPF Data Binding - Part 1[^]

A Guided Tour of WPF – Part 3 (Data binding)[^]


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

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