I have used data binding in my project in earlier version of WPF. I have used DataGrid from wpf toolkit and used DataGridTextColumn and DataGridTemplateColumn with DatePicker and ComboBox inside it to update particular cell's value. I have bound it with a business object that implements INotifyPropertyChanged interface. Earlier this was working fine but recently we moved to WPF 4.0 and this functionality is not working. I am getting error message "Two-way binding requires Path or XPath." and fields of my business objects are also not getting updated. Is there any change in Data Binding in WPF 4.0? Please help!!
Asked
Active
Viewed 241 times
-2
-
2Can you show the xaml for the binding in question? – Reed Copsey Sep 09 '11 at 16:40
-
could you post the xaml in question? – Ashley Grenon Sep 09 '11 at 16:40
1 Answers
2
There are no (significant) changes to how Data Binding works in .NET 4 vs. .NET 3.5. However, if you're using the Framework's DataGrid class instead of the WPF Toolkit's DataGrid, there are changes in that control itself.
I suspect this is due to a problem in how you were implementing that control originally. You should be specifying a Binding using {Binding}
and not {Binding Path=Something}
, which isn't likely to be exactly what you intended, at least not without a data template in place for the object in question.

Reed Copsey
- 554,122
- 78
- 1,158
- 1,373
-
I was using DataGrid from wpf toolkit but now it is of WPf 4.0, but not updated the way of using it. Can you give me some details on how to use it in WPF 4.0? – viky Sep 09 '11 at 16:52
-
@viky: The main thing is that you should be specifying a path on your binding (just like the error says). – Reed Copsey Sep 09 '11 at 16:53