Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
posted

Hi,

I am using "WebHierarchicalDataGrid" with List as a data source.  In data source there is Parent and Child relationship like Dept -> Employee.

I am exporting grid data using "WebDocumentExporter". Now when I export data using "DataExportMode = DataExportMode.AllDataInDataSource" then exporter throws following error.

"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

If I remove "DataExportMode = DataExportMode.AllDataInDataSource" property setting of "WebDocumentExporter" it export first level of grid data successfully.

I am using Infragistics 2011.1 version. Please help me to resolve this issue.

Thanks.

  • 180
    posted

    By adding following line of code has solved my problem.

    WebDocumentExporter.TargetPaperOrientation 
    = Infragistics.Documents.Reports.Report.PageOrientation.Landscape;

  • 20
    posted

    we have migrated our Infragistics from v5.3 to V11.1 . There were absolutely no compilation errors. Also all pages seem to work fine except one page. In that page we use the UltrawebGrid. When debugged, the grid seemed to bind succesfully in the Page_Load and also the Initialize event of the grid also went through successfully. But finally we are getting the below error. We are not able to figure out which code is throwing this exception. But the error message seem to be with the grid only. could you please suggest a solution for this issue. Fixing this outstanding solution would save all our migration effort. Please help.

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: startIndex

    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: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: startIndex

    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: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: startIndex]
       System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType) +12782250
       System.String.IndexOf(String value, Int32 startIndex, StringComparison comparisonType) +23
       Infragistics.WebUI.UltraWebGrid.UltraWebGrid.IdentifyDocumentType(Page p) +621
       Infragistics.WebUI.UltraWebGrid.UltraWebGrid.get_DocumentType() +215
       Infragistics.WebUI.UltraWebGrid.RenderDHTMLGrid.RenderTableFrameStyle() +952
       Infragistics.WebUI.UltraWebGrid.RenderDHTMLGrid.RenderTableFrame() +1072
       Infragistics.WebUI.UltraWebGrid.RenderDHTMLGrid.VisitObjects(HtmlTextWriter output) +1422
       Infragistics.WebUI.UltraWebGrid.GridRendererBase.Render(HtmlTextWriter output) +537
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +315
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +48
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
       System.Web.UI.Page.Render(HtmlTextWriter writer) +40
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint