radComboBox.DataSource and radcomboBox.Items NOT matching

4 posts, 0 answers
  1. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 21 Dec 2009 Link to this post

    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.
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 22 Dec 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 22 Dec 2009 Link to this post

    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.
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 23 Dec 2009 Link to this post

    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.
Back to Top