0
我使用的DevExpress 13.1和我想創建一個自定義的驗證提供了一個文本框創建自定義的驗證供應商的DevExpress
我嘗試用這個代碼
DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule containsValidationRule = new DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule();
containsValidationRule.ConditionOperator = DevExpress.XtraEditors.DXErrorProvider.ConditionOperator.GreaterOrEqual;
containsValidationRule.Value1 = '0';
containsValidationRule.ErrorText = "Veuillez saisir un valeur supérieur a zéro";
containsValidationRule.ErrorType = ErrorType.Warning;
CompareAgainstControlValidationRule compValidationRule = new CompareAgainstControlValidationRule();
compValidationRule.Control = txtStockMax;
compValidationRule.CompareControlOperator = CompareControlOperator.LessOrEqual;
compValidationRule.ErrorText = "Veuillez saisir un valeur inférieur au stock max";
compValidationRule.CaseSensitive = true;
dxValidationProvider1.SetValidationRule(txtStockMin, containsValidationRule);
dxValidationProvider1.SetValidationRule(txtStockMin, compValidationRule);
我要找的是該txtStockMin
是greaterOrEqual
比0和txtStockMin
是lessOrEqual
到txtStockMax