This is a migrated thread and some comments may be shown as answers.

DataSource Set in Form Constructor

1 Answer 80 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew Powrie
Top achievements
Rank 1
Andrew Powrie asked on 02 Dec 2009, 04:10 AM
My program used to be able to access the Item list for a CombBox loaded from a DataTable whilst still in the form Constuctor.  Now it appears that the Item list is not filled in until the Constructor finishes.  If I move the code into a timer event that fires after the Constructor is finished, the Item list is accessable imediately after the DataSource has been set. 

Has there been a deliberate change to create this situation or should I not be setting DataSources in Constructors?

1 Answer, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 03 Dec 2009, 09:29 AM
Hello Andrew,

Thanks for writing and for your question.

Q3 2009 release of RadControls for WinForms introduced some improvements in databinding mechanism of RadComboBox. Currently, the Items collection is populated after the Binding Context has been initialized  (which does not happen in the constructor).

In your case, my suggestion is that you access the combo box items in the OnLoad event of your form or in the BindingContextChanged event of RadComboBox.

I hope this is helpful. You can write back anytime you need further assistance.

Kind regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Andrew Powrie
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or