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
close icon

Cross-thread operation not valid exception for ComboBoxBase control.

Hi,

Following code is not working with Syncfusion 5.1 version. It works fine with 4.3 version. With 5.1 version i still get "Cross-thread operation not valid" after i handle it. Can you please suggest me regarding this.

private delegate void SetListBoxSelectedIndexCallback(int selectedIndex);
private void SetListBoxSelectedIndexProperty(int selectedIndex)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (comboBoxBase.ListControl.InvokeRequired)
{
SetListBoxSelectedIndexCallback d = new SetListBoxSelectedIndexCallback(SetListBoxSelectedIndexProperty);
this.Invoke(d, new object[] { selectedIndex });
}
else
{
this.comboBoxBase.ListControl.SelectedIndex = selectedIndex;
}
}

Thanks,
-Ravi.

1 Reply

MU Murugan Syncfusion Team May 22, 2007 11:53 PM UTC

Hi Ravi,

We regret for the inconvenience caused. Could please provide the following details to reproduce the issue as you mentioned?

1.When is the specified method SetListBoxSelectedIndexProperty called?
2.Are you using separate Thread to open the ParentForm?
3.Could you please provide us the sample that is having the issue?

The above details will help us to reproduce the issue and resolve the issue soon.

Thank you for your interest in Syncfusion products.

Regards,
Murugan P.S

Loader.
Live Chat Icon For mobile
Up arrow icon