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

radComboBox.DataSource and radcomboBox.Items NOT matching

3 Answers 155 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.
SUNIL
Top achievements
Rank 2
Iron
SUNIL asked on 21 Dec 2009, 04:52 PM
Anybody has come across a situation where the radComboBox.DataSource is not null and different from radComboBox.Items even after going through the regular databinding code for a radcombbox?
I was curious since I have just come across such a case. I am using latest Q3 version of Winforms RadControls.

I have found that the radComboBox.DataSource is not null but a generic List<> with a count of 4 elements and the radComboBox.Items  collection is a count of 0 elements.
To me this seems strange and counter-intuitive.

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 22 Dec 2009, 10:17 AM
Hello Sunil,

Thank you for your question. 

I have answered this question in your other thread related to RadComboBox. Please write again if you have any other questions.

Sincerely yours,

Victor
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.
0
SUNIL
Top achievements
Rank 2
Iron
answered on 22 Dec 2009, 02:52 PM
I think the scenario where RadComboBox.datasource has 4 items and  and RadComboBox.items has 0 items, with neither being null, is very counter-intuitive. 
Microsoft combo never behaves like this after I fully investigated using Microsoft combo in a similar situation. Such behaviour by Telerik combobox makes programming very ugly and hack-oriented, where the programmer is trying to get around an ugly situation such as the one mentioned here by using some hacks. It results in a very bad style of programming that is not easy to maintain. Also, it results in more time being spent by the programmer on a problem as he/she tries to come up with hacks, and also more time being spent in providing support by Telerik staff.
An intuitive model is a win-win situation both for the customers and Telerik.

I think your controls should allow the programmers to write clear and clean code, and not one that seems  full of hacks.
0
Victor
Telerik team
answered on 23 Dec 2009, 09:38 AM
Hello Sunil,

I agree that our controls are somewhat unintuitive at times and our support is supposed to handle such cases. For this particular case however the issue is easily solved by manually setting a binding context on the parent form before setting the DataSource property. A simple, one line, assignment. Please write again if you need further assistance with our controls.

All the best,
Victor
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
SUNIL
Top achievements
Rank 2
Iron
Answers by
Victor
Telerik team
SUNIL
Top achievements
Rank 2
Iron
Share this question
or