This is a migrated thread and some comments may be shown as answers.

More Detail from ArgumentOutOfRangeException

8 Answers 205 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 20 Mar 2012, 09:53 AM

I have a .NET 4.0 web application which implements an error handler within the Application_Error event of Global.asax.

When an exception occurs this intercepts it and sends me an email including a variety of information like the logged in user, the page the error occurred on, the contents of the session etc.

This is all great but there is some fundamental detail missing which I seem unable to locate, i.e. the name of the control or the value that caused it to be out of range:


Selection out of range
Parameter name: value

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentOutOfRangeException: Selection out of range
Parameter name: value

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentOutOfRangeException: Selection out of range
Parameter name: value]
   Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) +172
   Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) +491
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +1256
   Telerik.Web.UI.RadComboBox.PerformSelect() +37
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.RadComboBox.DataBind() +70
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
   Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +36
   Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

8 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 22 Mar 2012, 04:44 PM
Hi,

As it appears from the stack trace provided, RadComboBox is the control which had caused this error. Could you share the implementation of your RadComboBox so I could inspect it?

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rick
Top achievements
Rank 1
answered on 22 Mar 2012, 05:31 PM
Hi there,

Thanks, I did realise it was a RadComboBox which caused the error.

My issue is that I have about 6 RadComboBox items on that page and it would really help if I knew WHICH one threw the exception.

Why is this information not shown in the stack trace?
0
Dimitar Terziev
Telerik team
answered on 27 Mar 2012, 08:47 AM
Hi,

The stack trace provides information about the methods which have been invoked prior to the occurrence of the exception.

Kind regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Naveen
Top achievements
Rank 1
answered on 25 Jan 2013, 05:14 PM
Hi Dimitar,

How do we know which among 6 RadComboBox controls has thrown the exception, since the exception doesn't mention the exact RadComboBox control which caused the issue.

Thanks,
Naveen
0
Dimitar Terziev
Telerik team
answered on 28 Jan 2013, 08:17 AM
Hi Naveen,

In general the stack trace does not provide information which instance of the combobox has caused the exception. Could you clarify what exactly is the experienced problem?

Kind regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Naveen
Top achievements
Rank 1
answered on 28 Jan 2013, 03:56 PM
Hi Dimitar,

I have a user control (OrderEntry.ascx) which has about 20 RadCombobox controls, some of them hidden.  On  the page load of OrderEntry.ascx control, data bind works fine without any issues. But when I do a post back and try to bind the data again to the user control OrderEntry.ascx, I am getting the below exception.   I could not figure out which combobox control,  is throwing this exception.
Please let me know if there is a way to figure out which combo box control is throwing this exception?   Is there a way to troubleshoot this problem ?   Is this a know issue ?

C# code

              this.OrderEntry..DataSource = custInfo;
                this.OrderEntry..DataBind();     /// Exception thrown in this line.




Exception Type:         System.ArgumentOutOfRangeException
Message:                Selection out of range
Parameter name: value
ActualValue:            NULL
ParamName:              value
Data:
TargetSite:             Void PerformDataBinding(System.Collections.IEnumerable)
HelpLink:               NULL
Source:                 RadComboBox.Net2

StackTrace Information
*************************
   at Telerik.WebControls.RadComboBox.PerformDataBinding(IEnumerable dataSource)
   at Telerik.WebControls.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at Telerik.WebControls.RadComboBox.OnDataBinding(EventArgs e)
   at Telerik.WebControls.RadComboBox.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at OrderEntryControl.DisplayCustomerAccountInformation(CustomerView view, FormMode mode) in c:\Controls\OrderEntryControl.ascx.cs:line 3164
   at OrderEntryControl.DisplaySubmittedScreenData(Boolean isTrader) in c:\Controls\OrderEntryControl.ascx.cs:line 3243
   at OrderEntryControl.ReviewOrder(CustomerOrder custOrder, Boolean checkForBrokenRules, List`1 boValidationResults) in c:\Controls\OrderEntryControl.ascx.cs:line 5038
   at OrderEntryControl.VerifyOrderButton_Click(Object sender, EventArgs e) in c:\Controls\OrderEntryControl.ascx.cs:line 4924
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


0
Constantin
Top achievements
Rank 1
answered on 13 Nov 2013, 03:03 PM
Just wanted to bump this and say that I agree that a littel more information in the Exception message would be nice, i. e. add the ID of the RadComboBox that caused the exception and maybe even the actual value that is out of range to the exception message.

As it is, it's near impossible to determine the cause of the error if you have more than a handful of RadComboBoxes on a page.
0
Subash
Top achievements
Rank 1
answered on 13 Jul 2018, 09:54 AM

Hey I'm also struck with the same issue. I cant able to find which RadComboBox causing this ArguementOutofRange exception. I'm having nearly 20 RadcomboBox in my page. So kindly share me any advise to find which the RadCombobox causing this issue. 

I'm looking forward for your fast reply with solution.

Tags
ComboBox
Asked by
Rick
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Rick
Top achievements
Rank 1
Naveen
Top achievements
Rank 1
Constantin
Top achievements
Rank 1
Subash
Top achievements
Rank 1
Share this question
or