While useful for debugging the error, a lot of people found this feature annoying since it meant that validation was continually being re-enabled without them realizing it (and on slow machines or with large documents this could slow down perf).
Rad Property Grid provides a convenient way to perform validation before data is committed. Error Message = "String value must not be an empty string! Cancel = True End If End If End Sub Private Sub rad Property Grid1_Edited(By Val sender As Object, By Val e As Property Grid Item Edited Event Args) Dim item As Property Grid Item = Try Cast(e.
Next - the property Grid tries to bind "Error" (I know I can fix this in code behind - but this would break my so far "no code behind" MVVM design) - but this isn't very important.
Last not least I implemented "Is Valid" like in the following snippet.
In the Property Validating event we check if an empty string is entered, if this is the case the validation fails, the error indicator is shown and the event is canceled.
If the value entered is valid in the Edited event we reset the error text and the error indicator is hidden: Private Sub rad Property Grid1_Property Validating(By Val sender As Object, By Val e As Property Validating Event Args) Dim item As Property Grid Item = Try Cast(e.
Search for propertygrid validating:
You can validate data by handling Property Validating event which is raised by Rad Property Grid when the current item changes or when the item loses input focus (when pressing the The code snippet below demonstrates simple data validation scenario.