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.
Syncfusion Feedback

ComboBoxAdv.SelectedIndex changed behavior

Thread ID:

Created:

Updated:

Platform:

Replies:

65911 Jul 27,2007 06:22 PM UTC Jul 31,2007 10:29 PM UTC Windows Forms 1
loading
Tags: Tools
Terry Foster
Asked On July 27, 2007 06:22 PM UTC

Hello,

I recently upgraded from 4.2.0.37 to 5.1.1.0 and noticed that some of my code does not work the same way it did before. I tracked it down to the ComboBoxAdv control. Basically, I had one of these controls on a modal form and when the form was closed, I would access the SelectedIndex property to see what the user selected in the ComboBoxAdv control. Previously, this worked fine, but now it seems to be maintaining a 'm_beforeCreatedIndex' that is returned once the containing form is closed (because 'Created' = false). Is this intended behavior or bug? Seems strange to me that I shouldn't be allowed to access the correct SelectedIndex after the containing form closes (System.Windows.Forms.ComboBox allows this).

Thanks,
Terry

J.Nagarajan [Syncfusion]
Replied On July 31, 2007 10:29 PM UTC

Hi Terry,

Thanks for your interest in Syncfusion product.

If you want to know the selected Index of the comboboxAdv control when you close the form then you can use SelectedIndex property of comboBoxAdv control. You can handle the From Closing event. Please refer to the following code snippet

private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.ShowDialog();
}

private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
Console.WriteLine(this.comboBoxAdv1.SelectedIndex.ToString());
}

I have attached the sample for your reference. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Tools.Windows/F65911/main.htm

Please refer to the sample and let me know if you have any questions.

Thanks,
Nagaraj

CONFIRMATION

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.

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

;