Pending Review
Last Updated: 08 Mar 2017 20:33 by Dennis
Created on: 08 Mar 2017 20:33
Category: ComboBox
Type: Feature Request
RadComboBox Add Attribute to Fix "Selection out of range" error
This error comes up often for this control and workarounds have been discussed and posted.  See below 

The feature request is the following:

1.  Add an Attribute to the RadComboBox, RadDropdownList (and any other controls that suffer from this issue).

2. Let's call the Attribute   --   AppendIfSelectedValueMissing.

3. This attribute would be a boolean (True / False).  Default is FALSE.

4. If AppendIfSelectedValueMissing=True  then when the value of record is being Databound to a RadComboBox, RadDropDownList, etc.  A check (or Try/Catch) would occur to ensure that the Value exists in the DataSourceList and if it does NOT exist in the list then the SelectedValue would be Appended to the List.  Thus, eliminating the "Selection out of range, Parameter, Value" error.

This occur often because some lists get changed over time; however, the historical data may have a value that is no longer on the list -- thus triggering the error.

For example, let's say we ask for a user's Favorite Color.  Our original list was:
Red, Green, Blue

but for some reason -- management, changing user requirements, etc. the new list is

Red, Orange, Blue

Now, if we DataBind a RadComboBox to a historical record with Green as value, we get the "Selection Out of Range" errror.

What I am proposing is -- if we set the AppendIfSelectedValueMissing = True then 
databinding to a historical record with Green would have the following occur.

List from DB ---   Red, Orange, Blue
SelectedValue --    Green
New List for Ctrl --  Red, Orange, Blue, Green

Thus, the error goes away, the historical data can stay the way it is and the lists can adjust their choices over time.

All good for everyone!!!

Thanks for your consideration.