I know that when data is about to be displayed, Convert()
method is called to convert the data and the converted data is displayed instead.
I'm wondering when ConvertBack()
method gets called? What is its purpose?
I've a DataGrid
whose ItemSource
is binded to some collection, and I've implemented IValueConverter
for one property of items in the collection. When I make IsReadOnly="True"
(in the DataGrid), then ConvertBack
method is called if I double-click on the cell (for which IValueConverter
is implemented) and then change the focus. But when I make IsReadOnly="False"
, then ConvertBack
method is never called, no matter what I do with the DataGrid
and its cells.
Please explain this behavior of DataGrid
cells and ConvertBack
method of IValueConverter
.
"The data binding engine calls this method when it propagates a value from the binding target to the binding source."
see msdn
you should post your binding for your cell with the valueconverter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With