WPF datagridcomboboxcolumn:如何管理值更改事件 [英] WPF datagridcomboboxcolumn: how to manage a value changed event

查看:90
本文介绍了WPF datagridcomboboxcolumn:如何管理值更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有组合框列的数据网格,如下所示:

I have a datagrid with a combobox column as following

<DataGridComboBoxColumn x:Name="DataGridComboBoxColumnBracketType" Width="70" Header="Tipo di staffa" SelectedValueBinding="{Binding type, UpdateSourceTrigger=PropertyChanged}" />


我希望当用户更改组合框的值时会引发一个事件.仅当值有效更改时才引发该事件,而不是在选择组合框时才可以引发该事件...可以这样做吗?


I want that, when user changes value of the combobox, it is raised an event. The event must be raised only when value effectively changes and not when combobox is selected...is it possible to do?

推荐答案

Francesco,

Hi Francesco,

通常我会使用基础数据类.在您的情况下,包含要绑定到的类型"-属性的类.当那一个改变时,您可以做一些事情.因此无需使用事件.

normally I would use the underlying data class. In your case the class that contains the "type"-Property you're binding to. When that one changes, you can do something. So there's no need to use an event.


这篇关于WPF datagridcomboboxcolumn:如何管理值更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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