I am not able to fully appreciate when IEditorDataFilter.Convert method gets called with different ConversionDirection.
Is there any document / article explaining this function ? And what is appropriate in various scenario.
For understanding, I prototyped one scenario where the column is bound to custom object. And I am implementing ConversionDirection.EditorToDisplay and ConversionDirection.EditorToOwner to get from and to the (custom object/grid). And its working for this scenario.
However I don't fully understand the function and its more of trial and error.
I don't think there's a whole lot of documentation on DataFilters.
But here's a basic overview:
There are 3 places that a value of a cell or an EditorControl are stored.
The DataFilter will fire any time the grid or editor control needs to convert one type into another. For example, when the user types into a cell, they are essential altering the Display value. When they leave the cell, the display value has to be converted into an editor value so that the cell can store it. So the DataFilter fires with the EditorToDisplay conversion. Then the grid has to update it's DataSource, so it converts the Editor value into an Owner value, so the EditorToOwner conversion is called.
When the grid is bound and creates the rows and cells for the first time, it has to do the reverse. It gets a value from the Owner and converts it to an EditorValue to be stored in the cell. So the OwnerToEditor conversion is called. Then when the cell is painted on the screen, it has to take the Editor value and display it, so it calls EditorToDisplay.
There are some other special cases where these conversions may get called, but that's the basic overview.