Has anyone used the Infragistics DataFilter with success? It appears my OwnerToEditor works just fine but the EditorToOwner causes a .NET System Exception error. I am not sure I am using the BOX correctly or not.
USING Progress.Lang.*.
USING Infragistics.Win.IEditorDataFilter.
USING System.Windows.Forms.CheckState.
USING Infragistics.Win.ConversionDirection.
CLASS CheckEditorYNDataFilter IMPLEMENTS IEditorDataFilter :
DEFINE PRIVATE VARIABLE State AS CheckState NO-UNDO.
DEFINE PRIVATE VARIABLE eSystemObject AS System.Object NO-UNDO.
METHOD PUBLIC System.Object Convert( INPUT conversionArgs AS Infragistics.Win.EditorDataFilterConvertArgs ):
CASE conversionArgs:Direction:
WHEN ConversionDirection:EditorToOwner THEN
DO:
conversionArgs:Handled = TRUE.
State = CAST (conversionArgs:VALUE, CheckState).
IF State = CheckState:CHECKED THEN
eSystemObject = BOX ("Y").
ELSE IF State = CheckState:Unchecked THEN
eSystemObject = BOX ("N").
RETURN eSystemObject.
END.
WHEN ConversionDirection:OwnerToEditor THEN
DO:
conversionArgs:Handled = TRUE.
IF conversionArgs:VALUE:ToString() = "Y" THEN
RETURN CheckState:CHECKED.
ELSE IF conversionArgs:VALUE:ToString() = "N" THEN
RETURN CheckState:Unchecked.
ELSE
RETURN CheckState:Indeterminate.
END.
END CASE.
END METHOD.
END CLASS.
I haven't tried your sample, but what kind of an exception (possibly with a stack trace) are you receiving?
Mike,
I heard from PTS that SP1 will be available today so I will attempt to reproduce on SP1 and post the results on the forum. I have since added a workaround by adding a hidden TextBox on the form to store the value and bind the TextBox to the bindingsource.
Thanks.