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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Howto:? validate comboboxext on selectionchange committed

Thread ID:





7768 Oct 9,2003 02:11 AM UTC Oct 10,2003 07:49 PM UTC WinForms 3
Tags: Tools
Asked On October 9, 2003 02:11 AM UTC

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

Arun Srinivasan [Syncfusion]
Replied On 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

Replied On 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); }

Arun Srinivasan [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon