I have a problem with setting the initial value in the combo box for which validation should not pass this value. E.g the combobox has (Please Select) as initial value, and the user can choose whichever countries he/she wants. Validation should not allow (Please Select) to go through and prompt the user to select a country.
This feature was in the original .net controls, but it is not in devexpress's control to set the initial value. Is there a way through it?
Thank you for your clarification.
ASPxComboBox does not have such a property. We have the ASPxComboBox - Support NullText for DropDown Mode suggestion about this functionality. Please track this to be notified about our progress. We can offer you a workaround. It is possible to add the required item to the ASPxComboBox and apply a custom validation rule to it. To realize this, set the ValidationSettings.EnableCustomValidation property to true, and handle the ASPxClientEdit.Validation event. Apply the required validation rules. Call the ASPxClientEdit.ValidateGroup in the standard Button ClientClick event handler, because standard buttons do force ASPxEditors validation.
You also can use the ASPxButton to more easily validate our controls. By default, page validation is performed when an ASPxButton control is clicked.
Attached is a sample.
Please let us know whether or not this approach suits your needs. If you need any further help on this subject, please feel free to reactivate this ticket.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.