Select to view content in your preferred language

Validation on FeatureDataForm

822
2
01-17-2012 07:29 AM
JayKappy
Frequent Contributor
I have a FeatureDataForm that has a date, text, and integer field for testing puposes...
I want the FDF to close as soon as the user clicks APPLY assuming that the form passes validation

If I bypass closing the form on "EditEnded" and type a letter in the integer textbox I can see the red indicator telling me that I have a data input error...hovering over it I it tells me that it is requiring an integer.
So I know its working fine....

MY question is how can I test the validation,which will run when I hit the APPLY button, so I can close the FDF automatically when the Validation passes...

I tried this but getting errors on the .ValidateItem not a member of ESRI.ArcGIS.Client.Toolkit.FeatureDataForm

        If FeatureDataForm.ValidateItem() Then
            ' can continue 
        Else
            ' cancel - not valid 
        End If


Thoughts?
0 Kudos
2 Replies
JayKappy
Frequent Contributor
Thinking I can use the FeatureDataForm.IsValid event???

Seems this is working for me...unless anyone has any other suggestions..

        If FeatureDataForm.IsValid Then
            'MessageBox.Show("Good")
            DataFormBorder.Visibility = Visibility.Collapsed
            CloseButton1.Visibility = Visibility.Collapsed
            BorderBox.Visibility = Visibility.Visible
            FeatureDataForm.IsReadOnly = True
        Else
            'MessageBox.Show("Bad")
        End If
0 Kudos
JenniferNery
Esri Regular Contributor
Yes this is correct, FeatureDataForm.IsValid property is set when an error is returned from updating a field and/or clicking apply. FeatureDataForm.EditEnded event is raised only if IsValid and updates to the attributes were commited successfully.
0 Kudos