We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Howto:? validate comboboxext on selectionchange committed

How can i validate the combobox from the SelectionChangeCommitted event without the validating event being called twice. TIA, Peter

3 Replies

AS Arun Srinivasan Syncfusion Team October 9, 2003 05:06 PM UTC

Hi Peter, We were unable to reproduce the behaviour you state above. Can you post information on how we can reproduce what you are encountering so that we can take a look Regards, Arun


PE Peter October 10, 2003 02:40 PM UTC

private void comboBoxExt1_Validating(object sender, System.ComponentModel.CancelEventArgs e) { // Logic code here // This code will get executed on the selection changed event if the user selected an item and during the validating event } private void comboBoxExt1_SelectionChangeCommitted(object sender, System.EventArgs e) { // check: is custom if (listControl1.SelectedIndex == -1) return; // validate this.comboBoxExt1_Validating(sender, null); }


AS Arun Srinivasan Syncfusion Team October 10, 2003 07:49 PM UTC

Hi Peter, Thanks for the update. Validating will be called whenever the control loses focus and I guess that is what you are referring to when you say that it is called twice as it is called in your SelectionChangeCommitted event. You could overcome this by setting a boolean flag and toggle it's value in your validation logic of both SelectionChangeCommitted and Validating events to ensure that it is called only once. Regards, Arun

Loader.
Live Chat Icon For mobile
Up arrow icon