Hi,
Inthat scenario, when I try to edit the selected item, you'll see thelist.Selected Value is not changed.
But if you press button to get the Selected Value, you'll it's already = null.
It should keep the selected value, because it's needed to update data (text), using the id as value in a DB table..
public partial class RadForm2 : Telerik.WinControls.UI.RadForm
{
RadDropDownList list = new RadDropDownList();
TextBox tb = new TextBox();
Button b = new Button();
public RadForm2()
{
InitializeComponent();
this.Controls.AddRange(new Control[] { list, tb, b });
list.DropDownStyle = RadDropDownStyle.DropDown;
list.Location = new Point(30, 30);
list.Width = 100;
list.Height = 25;
list.DisplayMember = "name";
list.ValueMember = "id";
list.NullText = "not selected";
list.SelectedValueChanged += list_SelectedValueChanged;
tb.Location = new Point(30, 70);
tb.Width = 100;
tb.Height = 25;
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(int));
dt.Columns.Add("name", typeof(string));
dt.Rows.Add(1, "one");
dt.Rows.Add(2, "two");
dt.Rows.Add(3, "three");
dt.Rows.Add(4, "four");
dt.Rows.Add(5, "five");
list.DataSource = dt;
b.Location = new Point(30, 110);
b.Width = 100;
b.Height = 25;
b.Text = "Get Selected Value";
b.Click += b_Click;
}
void b_Click(object sender, EventArgs e)
{
tb.Text = list.SelectedValue + " <----> " + list.SelectedText;
}
void list_SelectedValueChanged(object sender, EventArgs e)
{
tb.Text = list.SelectedValue + " <----> " + list.SelectedText;
}
}