Problem with RadDropDownList and BindingSource

2 posts, 0 answers
  1. George Saveliev
    George Saveliev avatar
    29 posts
    Member since:
    May 2009

    Posted 19 Jul 2011 Link to this post

    Hello!

    I found the following problem with the latest (v.2011.2 11.712) RadDropDownList:

    The drop-down list is bound to the BindingSource. When I assign the binding source's DataSource to a list, the drop-down list control shows the first item but the SelectedItem and SelectedValue fields are still set to null as well as the SelectedIndex is set to -1. In the earlier version the fields were set to the corresponding values. If I assign the drop-down list's DataSource to a list directly, it works well.
    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
      
    namespace Test
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
      
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
      
                List<Data> list = new List<Data>();
                list.Add(new Data() { Value = "A" });
                list.Add(new Data() { Value = "B" });
                list.Add(new Data() { Value = "C" });
      
                radDropDownList1.ValueMember = radDropDownList1.DisplayMember = "Value";
                radDropDownList1.DataSource = bindingSource;
                bindingSource.DataSource = list;
            }
        }
      
        public class Data
        {
            public string Value { get; set; }
        }
    }

    This is very upsetting issue, because a lot of already tested code places becomes unstable unexpectedly. 

    Thank you.
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 21 Jul 2011 Link to this post

    Hello George,

    Thank you for writing.

    I can confirm this wrong behavior. We will provide fix for it in our SP release at the end of August.
    For now as a workaround, you can assign a list directly as a DataSource or set the BindingSource.DataSource first.

    We have added points to your account for reporting the issue. Do not hesitate to contact us if you have other questions.

    Regards,
    Peter
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top