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

Howto:? validate comboboxext on selectionchange committed

Thread ID:





7768 Oct 8,2003 10:11 PM Oct 10,2003 03:49 PM Windows Forms 3
Tags: Tools
Asked On October 8, 2003 10:11 PM

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 01:06 PM

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 10:40 AM

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 03:49 PM

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.

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.