private void chkNewTrackNumber_CheckedChanged(object sender, EventArgs e) { try { if (chkNewTrackNumber.Checked) { txtTrackNumber.EditValue = null; txtTrackNumber.Enabled = false; ValidationProvider.RemoveControlError(txtTrackNumber); } else { txtTrackNumber.Enabled = true; if (txtTrackNumber.EditValue != null) { txtTrackNumber.EditValue = null; } DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule conditionValidationRule = new DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule(); conditionValidationRule.ConditionOperator = DevExpress.XtraEditors.DXErrorProvider.ConditionOperator.IsNotBlank; conditionValidationRule.ErrorText = "Select Tracking Number ..."; conditionValidationRule.ErrorType = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical; ValidationProvider.SetValidationRule(txtTrackNumber, conditionValidationRule); } } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }