Use the overrideed method:
/// <summary>
/// Returns true if a color is selected. Otherwise, it returns false and displays an error message.
/// </summary>
public override bool IsValid()
{
if ((string)Value != "")
{
return true;
}
else
{
// Sets the form control validation error message
this.ValidationError = "Please choose a color.";
return false;
}
}
Inside the else
statement perform your validation on the field or expressions you want to validate and return a message based on what you're validating.