question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Test steps:

  1. when the grid is loaded (default page size is 10)

  2. i navigate to the last page

  3. then change the page size to 50 or any number which is greater than 10.

  4. then the ArgumentOutOfRangeException comes out.

    dll version: DevExtreme.AspNet.Data 2.2.0

    npm packages: “devextreme”: “^18.2.7”, “devextreme-angular”: “^18.2.7”, “devextreme-aspnet-data-nojquery”: “^2.2.0”,

DataSourceLoadOptions
    DefaultSort: null
    Filter: null
    Group: null
    GroupSummary: null
    IsCountQuery: false
    PaginateViaPrimaryKey: true
    PreSelect: null
    PrimaryKey: {string[1]}
    RemoteGrouping: null
    RemoteSelect: null
    RequireGroupCount: false
    RequireTotalCount: true
    Select: null
    Skip: 200
    Sort: null
    StringToLower: null
    Take: 50
    TotalSummary: null
  System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index)
   at DevExtreme.AspNet.Data.FilterExpressionCompiler`1.CompileCore(ParameterExpression dataItemExpr, IList criteriaJson)
   at DevExtreme.AspNet.Data.FilterExpressionCompiler`1.Compile(IList criteriaJson)
   at DevExtreme.AspNet.Data.DataSourceExpressionBuilder`1.BuildCore(Expression expr, Boolean paginate, Boolean isCountQuery, Boolean remoteGrouping, IList filterOverride, IReadOnlyList`1 selectOverride)
   at DevExtreme.AspNet.Data.DataSourceLoaderImpl`1.Load()

<dx-data-grid id="grid" [dataSource]="dataSource" [wordWrapEnabled]="true" [allowColumnReordering]="true"
    height="600" showBorders="true">
    <dxo-paging [pageSize]="10"></dxo-paging>
    <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10,20,50]"></dxo-pager>
    <dxo-selection mode="multiple"></dxo-selection>
    <dxo-filter-row [visible]="true"></dxo-filter-row>
    <dxo-header-filter [visible]="true"></dxo-header-filter>
    <dxo-group-panel [visible]="true"></dxo-group-panel> 
    <dxo-grouping [autoExpandAll]="false"></dxo-grouping>
    <dxo-remote-operations [sorting]="true" [paging]="true" [filtering]='true' [grouping]='true' [groupPaging]='true'>
    </dxo-remote-operations>
    <dxi-column dataField="id" width="280">
    </dxi-column>
    <dxi-column dataField="parentId" width="280" [allowSearch]="true">
    </dxi-column>
    <dxi-column dataField="displayName" [allowSearch]="true">
    </dxi-column>
    <dxi-column dataField="position" width="75" [allowSearch]="true">
    </dxi-column>
    <dxi-column dataField="type" width="100" [allowSearch]="true">
    </dxi-column>
    <dxi-column dataField="iconId" width="100" [allowSearch]="true">
    </dxi-column>
  </dx-data-grid>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
Bykievcommented, Apr 25, 2019

@AlekseyMartynov, AppVeyor issue is resolved, any news when the update will be available on NuGet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index was out of range. Must be non-negative and less ...
It means that you are accessing a location or index which is not present in collection. To find this, Make sure your Gridview...
Read more >
Index was out of range. Must be non-negative and less ...
Quote: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. The message tells you ...
Read more >
[Solved] Index was out of range. Must be non-negative and ...
ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Read more >
Index was out of range. Must be non-negative and less ...
In the 1st video tutorial I encounter the "Index was out of range. Must be non-negative and less than the size of the...
Read more >
Index was out of range. Must be non-negative and l...
Must be non-negative and less than the size of the collection. Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found