KendoGrid only shows last chunk rows when virtualscroll after sort

4 Answers 271 Views
Grid
changcheng
Top achievements
Rank 1
Iron
changcheng asked on 16 Jun 2021, 06:50 AM

  1. Enable serverPaging, serverSorting, virtual scroll. Please refer the attached codes.
  2. Run the page in browser.
  3. Drag scrollbar to end
  4. Click "name" column header to sort the grid.

Observed:

Grid only shows the last 3 rows.

Question:

How can I make last ten rows show after sort? Like this:


<html>
	<head>

		<link rel="stylesheet" href="styles/kendo.common.min.css"/>
		<link rel="stylesheet" href="styles/kendo.default.min.css"/>

		<script src="jquery-3.6.0.js"></script>
		<script src="kendo.all.js"></script>

		<style>
			.grid {
				width: 800px;
				height: 400px;
			}
		</style>
	</head>
	<body>
		<div class="grid"></div>
<script>
	$(()=>{
	var ds = [];
	for(var i=0;i<13;i++){
		ds[i]={name:i.toString(),number:i};
	}

	var dataSource = new kendo.data.DataSource({
		serverPaging:true,
		serverSorting:true,
		pageSize:10,
		type: "odata",
		transport: {
			read: options=>{
				var d=[];
				for(var i =options.data.skip;i<options.data.skip+options.data.take && i<ds.length;i++){
					d.push(ds[i]);
				}

				var r = {
					d: {
						__count: ds.length,
						results: d
					}
				};

				options.success(r);
			}
		}
	});

	$(".grid").kendoGrid(
		{
			sortable:true,
			columns:["name","number"],
			dataSource:dataSource,
			scrollable: {
				virtual: true
			}
		}
	);
});
</script>
	</body>
</html>

changcheng
Top achievements
Rank 1
Iron
commented on 18 Jun 2021, 05:48 AM

Can anyone help? Thanks.

4 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 20 Jun 2021, 11:22 PM

Hello,

I will need a little bit more time to review the issue. I will get back to you once I have some information to share.

Thank you very much for your patience.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Neli
Telerik team
answered on 21 Jun 2021, 01:37 PM

Hello,

In order for the virtualization to work correctly in the described scenario, you need to set a smaller height to the Grid.

Here is the modified Dojo example. 

Let me know if you have further questions.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

changcheng
Top achievements
Rank 1
Iron
commented on 21 Jun 2021, 01:45 PM

thanks for your reply. In fact, in our project, the grid height is bigger, almost full screen. So I cannot decrease the grid height. I will appreciate if there are any other solutions.
Neli
Telerik team
commented on 24 Jun 2021, 09:00 AM

Hi,

What you could try is to increase the height of the Grid rows. You could take a look at the related knowledge base article linked below:

https://docs.telerik.com/kendo-ui/knowledge-base/edit-row-height-with-virtual-scrolling

Regards,

Neli

changcheng
Top achievements
Rank 1
Iron
commented on 28 Jun 2021, 07:22 AM

Changing row height cannot solve this issue. It still exists. Anyway, we cannot change row height in out product.
Martin
Telerik team
commented on 01 Jul 2021, 07:01 AM

As stated in our documentation, the virtual scrolling depends on several configurations, one of which is the Grid height. In general, the virtual scrolling feature is intended to be used with huge amount of data and it does not make much sense to use it for only 13 items. Nevertheless, if you need to do that, you will need to set a smaller height for the Grid in order for the feature to work correctly, as stated previously by my colleague. I suggest going through the virtual scrolling documentation and demo for further guidance. 
changcheng
Top achievements
Rank 1
Iron
commented on 01 Jul 2021, 07:31 AM

If you change data to 100003 records, this issue also happens. Is this a bug?
Neli
Telerik team
commented on 06 Jul 2021, 07:33 AM

Hi,

Note, that in the example you have provided in your first reply serverSorting is enabled. However, the sorting for the server response is not implemented. You will need to either implement the sorting for the response or you could leave the sorting to the client, by removing the serverSorting configuration. 

You could take a look at our Grid Virtualization of local and remote data demos linked below:

- https://demos.telerik.com/kendo-ui/grid/virtualization-remote-data

https://demos.telerik.com/kendo-ui/grid/virtualization-local-data

And here is a Dojo example based on the demo of virtualization of local data where the sorting on the client is enabled. 

Let me know in case you have additional questions.

0
changcheng
Top achievements
Rank 1
Iron
answered on 07 Jul 2021, 06:17 AM

Hi Neli,

The sample I provided is simplized. In our procuct, we implement soring, paging in remote.

In the sample you shared, this issue also exists. Is this a bug?

0
Neli
Telerik team
answered on 09 Jul 2021, 02:07 PM

Hi,

I discussed the issue with a developer from the team. It is a bug on our end and based on the described scenario I logged a Bug Report on your behalf in our official Feedback Portal. Below you will find a link to the issue:

https://feedback.telerik.com/kendo-jquery-ui/1527236-grid-with-local-data-and-virtualization-does-not-show-correct-items-when-sorted

As a small token of gratitude for reporting incorrect behavior, your Telerik points are now updated. 

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

changcheng
Top achievements
Rank 1
Iron
commented on 13 Jul 2021, 01:38 AM

Thanks, Neli. Hope this can be fixed quickly. Another question, is there any workaround for this issue?
Neli
Telerik team
commented on 15 Jul 2021, 09:38 AM

Hi,

I am afraid that currently, I could not suggest a workaround for the issue. In case we find one, we update the thread with the Bug Report. You could follow the issue in the Feedback Portal in order to be notified when we have progress on it.

Regards,

Neli

changcheng
Top achievements
Rank 1
Iron
commented on 09 Dec 2025, 09:26 AM

Neli
Telerik team
commented on 12 Dec 2025, 09:21 AM

Hi,

Thank you for the additional details provided. I will review the described steps and will follow up shortly. 

Thank you very much for your patience.

Regards,

Neli

Neli
Telerik team
commented on 16 Dec 2025, 07:02 AM

Hi,

Thank you very much for your patience.

I reviewed the information and example provided in the Bug Report issue

In the example test.html I noticed that the serverPaging and serverSorting are enabled. However, there is no related code when returning the result in the read function that will handle the sorting scenario. Note, that when the serverSorting is enabled the sorting should be performed on the server.

Regarding the scenario with the modified Demo - I tested the example and tried to replicate the issue following the provided video. However, the issue is not reproduced on my side. Here is a screencast demonstrating the behavior on my end. Could yo uplease let me know if I am missing something?

Looking forward to your reply.

changcheng
Top achievements
Rank 1
Iron
commented on 16 Dec 2025, 01:18 PM

Hi Neli,

Thanks for your reply.

I found an easier way to reproduce the issue. Steps:

  1. Open the only grid demo Untitled | Kendo UI Dojo
  2. Change pageSize to 21.
  3. Run the sample.
  4. Scroll down to grid bottom.
  5. Click the first column to sort.

Notice the items don't fill the grid viewport completely. Please refer to the screenshot and attached video.

It should be a bug, right? Is there any workaround?

Thanks,

JCC

 

Neli
Telerik team
commented on 19 Dec 2025, 10:35 AM

Hi,

The observed appearance is expected as the last page of data contains less items. When following the steps in the example provided in your last reply there are no missing items or page with data and all the items are correctly loaded and sorted.

Regards,

Neli

changcheng
Top achievements
Rank 1
Iron
commented on 22 Dec 2025, 08:30 AM

I think what you say now is different from the original bug expected behavior.

Expected/desired behavior

Enough items to fill the Grid height should be displayed. There should be no blank space without records.

Why not is it a bug now? I am confusing.

Neli
Telerik team
commented on 23 Dec 2025, 06:46 AM

Hi,

I will double-check and verify the current behavior with a member of the development team. However, given the holiday season, I will be able to provide an update on the matter at the beginning of January.

Thank you very much for your patience.

Wish you Happy Holidays!

Regards,

Neli

Neli
Telerik team
commented on 12 Jan 2026, 07:09 AM

Hi, 

Thank you very much for your patience.

I discussed the issue again with a developer, and I can confirm that the observed behavior is considered a bug on our side. Please excuse me for misleading you in my previous reply.

I have logged the item on your behalf in our Feedback Portal:

- https://feedback.telerik.com/kendo-jquery-ui/1707607-grid-with-virtualization-does-not-fill-the-entire-tables-with-items-after-sorting

Please follow the issue in the portal to be notified when its status is updated.

As a token of our gratitude for reporting the issue, I have increased your Telerik points.

Regards,

Neli

changcheng
Top achievements
Rank 1
Iron
commented on 12 Jan 2026, 08:56 AM

Thanks, Neli. Hope this issue can be resolved soon.
Neli
Telerik team
commented on 15 Jan 2026, 08:53 AM

Hi,

I am afraid can not provide a specific timeframe on when the issue will be fixed. Bug fixes are prioritized based on severity, impact, and overall priority.

For this reason, we advise our customers to subscribe to the issues and receive notifications when there is any progress on the status of the bug.

Regards,

Neli

Tags
Grid
Asked by
changcheng
Top achievements
Rank 1
Iron
Answers by
Neli
Telerik team
changcheng
Top achievements
Rank 1
Iron
Share this question
or