ArgumentOutOfRangeException from Telerik.Web.UI.RadComboBox.PerformDataBinding()
My project using RadComboBox control throws exception below. The exception occurs intermittently and randomly. That is, it happens for the same user some times.
Exception below:
1) Exception Information
*********************************************
Exception Type: System.ArgumentOutOfRangeException
Message: Selection out of range
Parameter name: value
Data: System.Collections.ListDictionaryInternal
TargetSite: Void PerformDataBinding(System.Collections.IEnumerable)
HelpLink:
Source: Telerik.Web.UI
StackTrace Information
*********************************************
at Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource)
at Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e)
at Telerik.Web.UI.RadComboBox.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at Telerik.Web.UI.RadComboBox.DataBind()
at xxx.Default.Page_Load(Object sender, EventArgs e) in d:\xxx\Default.aspx.cs:line 34
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Assembly Information:
Assembly Telerik.Web.UI, Version=2014.3.1024.40, Culture=neutral, PublicKeyToken=121fae78165ba3d
Project Information:
ASP.NET, .NET 4.6
Telerik.Web.UI.RadComboBox Source code:
protected override void PerformDataBinding(IEnumerable dataSource)
{
base.PerformDataBinding(dataSource);
if (!string.IsNullOrEmpty(this.cachedSelectedValue))
{
RadComboBoxItem itemByValue = this.FindItemByValue(this.cachedSelectedValue);
if (itemByValue == null)
throw new ArgumentOutOfRangeException("value", "Selection out of range");
int num = this.Items.IndexOf(itemByValue);
if (this.cachedSelectedIndex != -1 && this.cachedSelectedIndex != num)
throw new ArgumentOutOfRangeException("value", "SelectedIndex and SelectedValue are mutually exclusive");
this.SelectedIndex = num;
this.cachedSelectedValue = (string) null;
this.cachedSelectedIndex = -1;
}
else if (this.cachedSelectedIndex != -1)
{
this.SelectedIndex = this.cachedSelectedIndex;
this.cachedSelectedIndex = -1;
}
this.UpdateFromCachedValueIndex();
}