sfdatagrid with sfdatapager index must be within bounds of the list

Support,

Environment: Syncfusion version 18.2.0.44 in Visual Studio 2019
I have an SfDataGrid control, along with an SfDataPager control with an observable collection bound to the pager. I can reproduce this every time in my current project. The following code exhibits the buggy behavior:

SfDataPager1.DataSource = logCollection;
SfDataGrid.DataSource = SfDataPager1.PagedSource;

The SfDataGrid has 2 columns of type GridTextColumn and both allow filtering. The first column is a date and time, while the second column is a message.

Now, when the form loads, I go and get data from a database, and store it in the logCollection observable collection. Over time, I will add new entries to via logCollection.Add().

So, when I filter the 2nd column (message) and then add a new item to the logCollection I get the following error:
Index must be within the bounds of the List. Parameter name: index

Also to note, when I add a new logCollection item, if the "message" is NOT the same as the text I'm filtering, no issues occur. The error above only exhibits itself when the new message added exactly matches that of the filtered text.

I can prevent this by not using the SfDataPager and by using the following code below instead of what I've indicated above:
SfDataGrid.DataSource = logCollection;

Data can be added to the collection and the new items appears in the filtered list without issue.

However, because this is a log, there will be thousands of lines, and I would like paging of that data for the user.
How can this be achieved?

Thanks.

2 Replies 1 reply marked as answer

ST Stoked January 3, 2021 08:25 PM UTC

I just noticed here in the documentation:
https://help.syncfusion.com/windowsforms/datagrid/paging#limitations-1

that:
  1. UI Filtering is not supported. You can code in application level to filter the data.
Can you confirm is this is still the case or if there is a workaround?

Thanks.


VS Vijayarasan Sivanandham Syncfusion Team January 4, 2021 02:24 PM UTC

Hi Stoked, 
Thank you for contacting Syncfusion support.

Please find answer for your queries below
 
Queries 
Solutions 

when I add a new logCollection item, if the "message" is NOT the same as the text I'm filtering, no issues occur. The error above only exhibits itself when the new message added exactly matches that of the filtered text.
 
 
I can prevent this by not using the SfDataPager and by using the following code below instead of what I've indicated above: 
SfDataGrid.DataSource = logCollection; 
 
 
 
Based on provided information we have checked the reported issue “sfdatagrid with sfdatapager index must be within bounds of the list” and unable to replicate the issue from our end. it is working fine as expected. Please find the tested sample and video demo from our end in the below link,

Sample link: https://www.syncfusion.com/downloads/support/forum/161121/ze/Sample1083959260
 
 
Can you please share us below things?       
        1. Brief replication procedure/video illustration of the reported issue
        2. Provide the c
ode snippet related customization in SfDataGrid and SfDataPager
                     
if you still facing the same issue? If yes, please modify the sample based on your scenario. 

If we misunderstood your requirement, please provide more information regarding the requirement. This would help us to proceed further.
 
 
I just noticed here in the documentation: 
that: 
  1. UI Filtering is not supported. You can code in application level to filter the data.
 


 
Based on provided information SfDataPager doesn’t support the UI Filter for Load Data in on-demand in SfDataGrid. We also regret to inform you that​​​ currently, Our SfDatagrid source architecture does not provide support to achieve your requirement of “UI Filtering support Load Data in on-demand in SfDataGrid”.



 

 
 


Regards,
Vijayarasan S
 


Marked as answer
Loader.
Up arrow icon