Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
896
XamDateTimeEditor Custom Event
posted

Hi

I have this requirement, I want to avoid the message box popping every time the Date editor is input with

an Invalid Date, I have created a custom control and in that this is what i am trying to do

 

 

 

 

 

 

 

 

 

Private

 

Sub XamDateTimeEditor_EditModeValidationError(ByVal Sender As Object, ByVal e As Infragistics.Windows.Editors.Events.EditModeValidationErrorEventArgs)

 

 

Try

e.InvalidValueBehavior = Infragistics.Windows.Editors.InvalidValueBehavior.RevertValue

//e.Handled = True

 

 

 

Catch ex As Exception

 

 

Throw ex

 

 

End Try

 

 

End Sub

But since its a routed event i guess the Pop Up Still Shows,Then i added the second line

i.e. e.Handled = True, Now the popUp has gone but neither am i able to access the

EditModeValidationError Event in the page i am using the Custom Control since I have already

handled it,Now why do i want to handle it is beacause in some of the pages i want to show the error

in a label at the top of the Page.I tried creating Custom Events but throws a compile time error

while binding it in Xaml

 

 

 

 

 

 

<

 

igDP:FieldSettings EditorType="{x:Type TrackerControls:TrackerXamDateTimeEditor}">

 

 

 

<igDP:FieldSettings.EditorStyle>

 

 

 

<Style TargetType="{x:Type TrackerControls:TrackerXamDateTimeEditor}">

 

 

 

<EventSetter Event="InvalidInputErrorEvent" Handler="XamDateTimeEditor_EditModeValidationError" />

 

 

 

</Style>

 

 

 

</igDP:FieldSettings.EditorStyle>

 

 

 

</igDP:FieldSettings>

 

Am i doing the right way or is there any other easier solution to it

 

 

 

 

Thanks in advance

Abhi

 

 

  • 54937
    Offline posted

    I'm not sure exactly what part you are asking for help on. The default value for the InvalidValueBehavior property of the EditModeValidationError event is based on the InvalidValueBehavior property of the value editor itself. If you were using the editor standalone then you would probably just set this property directly. Since it appears you are using this within the datapresenter, you could either set it on the FieldSettings->InvalidValueBehavior or you could set it in the setters of the EditorStyle on the editor itself.