Use the following code snippet and click the button to delete the first item from the BindingList:
BindingList<DoctorTest> list = new BindingList<DoctorTest>();
public RadForm1()
{
InitializeComponent();
for (int i = 0; i < 5; i++)
{
list.Add(new DoctorTest(i,"Item"+i));
}
this.radDropDownList1.DisplayMember = "Name";
this.radDropDownList1.ValueMember = "Id";
this.radDropDownList1.DataSource = list;
this.radDropDownList1.SelectedIndex = 4;
this.radDropDownList1.SelectedValueChanged+=radDropDownList1_SelectedValueChanged;
}
private void radDropDownList1_SelectedValueChanged(object sender, EventArgs e)
{
RadMessageBox.Show(this.radDropDownList1.SelectedValue +" ---");
}
public class DoctorTest
{
public int Id { get; set; }
public string Name { get; set; }
public DoctorTest(int id, string name)
{
this.Id = id;
this.Name = name;
}
}
private void radButton1_Click(object sender, EventArgs e)
{
list.RemoveAt(0);
}