Virtualization

1 Answer 31 Views
ComboBox
Robert
Top achievements
Rank 1
Iron
Veteran
Robert asked on 14 Dec 2021, 01:25 PM

Hi.

 

Trying to use virtualization in the Combobox with a remote data source, but the DataSourceRequest.Page in OnRead is always 0.
How to fix that?

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 17 Dec 2021, 10:54 AM

Hi Robert,

The remote data source provides PageSize and Skip for the ComboBox virtualization. These properties give the information for the scrolling state. You can find more details in our article for working with remote data.

There is one more thing to mention - ComboBox virtualization has a limitation. When the initially selected item/items are on a page different than the first one, opening the dropdown list will not scroll the list to the selected item.

Based on the above specifics, you can test our Remote Data example. If you see unexpected behavior, please send us a small runnable sample that shows the issue.

Thank you.

Regards,
Hristian Stefanov
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!
Robert
Top achievements
Rank 1
Iron
Veteran
commented on 14 Jan 2022, 01:29 PM

The example doesn't use PageSize or Skip.
Hristian Stefanov
Telerik team
commented on 19 Jan 2022, 09:26 AM

Hi Robert,

I tested the Remote Data example, and I get correctly the PageSize/Skip.

Please run the above example in debug mode and enter the OnRead handler - "GetRemoteData(ComboBoxReadEventArgs e)". Try to scroll, and see how the event arguments are providing the current PageSize/Skip.

Let me know if the result you get is different.

Robert
Top achievements
Rank 1
Iron
Veteran
commented on 19 Jan 2022, 01:15 PM

Yes, they are provided, but the example doesn't apply them.

If page size is 20 and skip is 5, what am I supposed to do?

If page size is 20 and skip is 25, what am I supposed to do?

Hristian Stefanov
Telerik team
commented on 24 Jan 2022, 07:33 AM

Hi Robert,

The PageSize/Skip provided from the OnRead arguments are already applied to the component. This happens automatically when you scroll. The OnRead arguments show the result of your current scroll action.

When you receive the current PageSize/Skip as a result of your action, you can do whatever your scenario requires with the provided data.

Regards,
Hristian Stefanov
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!
Robert
Top achievements
Rank 1
Iron
Veteran
commented on 24 Jan 2022, 10:25 AM

Ok, I see. The example uses the built in functionality via
ToDataSourceResultAsync
My situation is different. I have an OData back end and thus cannot use this built-in behavior.
I'd like some more information about how to apply PageSize/Skip in my request to the back end.
Robert
Top achievements
Rank 1
Iron
Veteran
commented on 24 Jan 2022, 02:08 PM

Never mind, found out about
DataSourceRequest.ToODataString()

Tags
ComboBox
Asked by
Robert
Top achievements
Rank 1
Iron
Veteran
Answers by
Hristian Stefanov
Telerik team
Share this question
or