Completed
Last Updated: 12 May 2016 06:10 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 04 May 2016 10:31
Category:
Type: Bug Report
0
FIX. RadDropDownList - selection is cleared after adding a new record to the DataSource and sorting is applied
To reproduce:

  BindingList<string> items = new BindingList<string>();

public Form1()
{
    InitializeComponent();
   
     for (int i = 0; i < 5; i++)
    {
        items.Add("item" + i); 
    }
    this.radDropDownList1.DataSource = items; 
    this.radDropDownList1.SortStyle = Telerik.WinControls.Enumerations.SortStyle.Descending;
}

private void button1_Click(object sender, EventArgs e)
{
    items.Add(DateTime.Now.ToLongTimeString());
}

Workaround: keep the selection before adding the item and restore it after that:

 int index = this.radDropDownList1.SelectedIndex;
 items.Add(DateTime.Now.ToLongTimeString());
 this.radDropDownList1.SelectedIndex = index;

0 comments