开发者

WPF validation rule problems in a datagrid

I'm having a problem using a validation rule in a data grid:

I want to use a ValidationRule on a DataGridComboBoxColumn, I used this example

for guidance, in particular the BindingGroup stuff.

This works to an extent but seems very broken. The ValidatioRule doesn't fire as soon as the combo box selection changes, instead it fires only when I change the selection then click on another row in the DataGrid. I real开发者_C百科ly need it to fire as soon as I have changed the selection of the combo box.

I've tried messing with the validation step but to no avail, can anybody help?

Thanks in advance!


You need to change the default UpdateSourceTrigger property for the ComboBox.

UpdateSourceTrigger=PropertyChanged

If that still doesn't work then check out this SO post which details the way to take care of the selection change not being forced into the model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜