More Detail from ArgumentOutOfRangeException

8 posts, 0 answers
  1. Rick
    Rick avatar
    49 posts
    Member since:
    Oct 2008

    Posted 20 Mar 2012 Link to this post

    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
    
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 22 Mar 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rick
    Rick avatar
    49 posts
    Member since:
    Oct 2008

    Posted 22 Mar 2012 Link to this post

    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?
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 27 Mar 2012 Link to this post

    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.
  6. Naveen
    Naveen avatar
    2 posts
    Member since:
    Jan 2013

    Posted 25 Jan 2013 Link to this post

    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
  7. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 28 Jan 2013 Link to this post

    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.
  8. Naveen
    Naveen avatar
    2 posts
    Member since:
    Jan 2013

    Posted 28 Jan 2013 Link to this post

    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)


  9. Constantin
    Constantin avatar
    12 posts
    Member since:
    Apr 2012

    Posted 13 Nov 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017