Wrong initial SelectedIndex in RadListControl/RadDropDownList when using DataSource property
Step to reproduce:
public RadForm1()
{
InitializeComponent();
this.radDropDownList1.DataSource = datasource;
this.radDropDownList1.SelectedIndex = -1;
}
private void radButton1_Click(object sender, EventArgs e)
{
MessageBox.Show("SelectedIndex= " + this.radDropDownList1.SelectedIndex);
}
Workaround:
this.radDropDownList1.ListElement.DataLayer.DataView.MoveCurrentToPosition(-1);
no, my workaround is not always working :)
other version of workaround: this.radDropDownList1.ListElement.DataLayer.Refresh();