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
.