I have a grid tied to an observable collection with a pre-sorted column using simple <GridSortSettings>.
I'm adding data in the background and everything works fine until after x number of intervals of loading data and the grid has around 40 something items. At this point, the grid will no longer show updates.
Without the <GridSortSettings> it works fine as it adds data to the bottom and you have to scroll down each time which is not desirable at all. Therefore, I need the new data at the top as to why I am using the sort settings. Do you know what the issue could be?
My grid sort settings are below.
<GridSortColumn Field="Column" Direction="SortDirection.Descending"></GridSortColumn>
Greetings from Syncfusion support
Query:” I need the new data at the top as to why I am using the sort settings”
We analyzed your query, and we would like to inform you that while performing add data will be appended to the grid based on the GridSortSettings of SfGrid.By removing the GridSortSettings data will append to the top of the grid. This is the default behavior grid.
Query:” adding data in the background and everything works fine until after x number of intervals of loading data and the grid has around 40 something items. At this point, the grid will no longer show updates.”
We have validated your query and we can’t be able to reproduce the reported issue at our end version[220.127.116.11].kindly upgrade to the latest version.
If the reported issue persists, or we misunderstood your query kindly share as the below details validate further at our end.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Thank you for the response and for sending the sample project. I implemented some changes from my project into your sample project and have been able to replicate the issue in this sample project. I believe the issue is tied to the virtualization functionality.
Please take a look at the attached project. I updated the project to generate new data on each button click. You will see initially when clicking the button, new data will be added that is sorted properly by the "order date" (descending by default based on how I setup the grid). Please continue clicking the button around 25-30 times or so. Eventually, you will notice the grid will stop updating properly.
If you remove the virtualization functionality from the grid, you will see the grid will update properly.
Please let me know if you have any questions.
Thanks for the update.
We are validating you given the modified sample and the reported issue has been replicated on our end. Further details will be updated on or before 22 Oct 2022.
Until then we appreciate your patience.
Sorry for the inconvenience caused.
Currently, we are validating your sample with high priority. Further details will be updated on or before 27 Oct 2022.
Sorry for the inconvenience delayed
We have checked your query and we would like to inform that refresh the grid by using the grid refresh method or you directly assign the data source properties for refresh when a new stream is received .please refer to the below sample solution and code for your reference.
<SfGrid DataSource="@GridData" @ref="Grid" TValue="OrdersDetailsObserveData" AllowSorting="true" EnableVirtualization="true" EnableColumnVirtualization="true" EnableHover="false" Height="800" Width="auto">
var j = getOrders();
y += 5;
kindly get back to us if you need further assistance.
Thank you Prathap!
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.