Unplanned
Last Updated: 06 Apr 2016 12:35 by ADMIN
ADMIN
Stefan
Created on: 04 Sep 2013 04:39
Category:
Type: Bug Report
1
FIX. RadDropDownList/RadListControl - binding the SelectedIndex property does not work as expected
To reproduce, add an int user setting in the project settings and use the following code to bind the control:

this.radDropDownList1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", global::BindingIssue.Properties.Settings.Default, "RadDropDownListIndex", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 

The result is that the control is notified of a change in the databound item, however, the control does not introduce the change in the databound item. 

Workaround - manually introduce the value change to the data bound item:

void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)

{ Properties.Settings.Default.RadDropDownListIndex = radDropDownList1. } 
1 comment
ADMIN
Stefan
Posted on: 06 Apr 2016 12:35
To add more context to this case, in our current implementation the SelectedIndexChanged event comes with PositionChangedEventArgs. At the same time, for the simple data binding to work, it has a requirement that this event uses the base EventArgs. While we could easily change this in our code, this will reflect in many client applications, which use the event and precisely its arguments. 

For the time being, we would like to see what would be the demand for this change with this item. If it proves that there is high demand (which is not present at this time) we could make this change. Until then, there is a simple workaround for the people in need of this functionality. 

Furthermore, the SelectedValueChanged can be used in simple data binding scenarios with no issues.