/// <summary> /// Clears the error for the specified control. /// </summary> /// <param name="control"> Control to clear the error message. </param> public void ClearError(Control control) { if (this.errorProvider != null) { NhsErrorProvider tmp = this.errorProvider as NhsErrorProvider; if (tmp != null) { tmp.SetError(control, String.Empty); } else { this.errorProvider.SetError(control, String.Empty); } } }
/// <summary> /// Sets the error message for the specified control. /// </summary> /// <param name="control"> Control to set error message. </param> /// <param name="errorMessage"> Error Message. </param> public void SetError(Control control, string errorMessage) { if (this.errorProvider != null) { NhsErrorProvider tmp = this.errorProvider as NhsErrorProvider; if (tmp != null) { tmp.SetError(control, errorMessage); } else { this.errorProvider.SetError(control, errorMessage); } } }