ListView within ScrollView

1 Answer 112 Views
ListView
Sean
Top achievements
Rank 2
Iron
Sean asked on 04 May 2024, 02:41 PM

From the Help Page...

The ListView provides UI virtualization, which requires the visual parent to provide vertical or horizontal space. To avoid breaking UI virtualization or gesture mechanisms:

  • Do not place the ListView inside a StackLayout or inside a ScrollView.
  • Do not set the ListView to a RowDefinition Height="Auto" Grid definition.

 

Does this mean that a ListView cant be placed as a child of a Scroll View under any circumstance, or its immediate parent cant be a ScrollView? Same question for the Grid RowDefinition. If using nested grids, must all parent grids rows have a Height specified, or is it only the immediate parent? Also is * ok for the Height?

Seems like ListView is severely limited to being the only control on the page/view if this is the case.

1 Answer, 1 is accepted

Sort by
0
Accepted
Didi
Telerik team
answered on 06 May 2024, 06:25 AM

Hi Sean,

In general, nesting scrollable objects is not recommended. You can check this here: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/scrollview?view=net-maui-8.0 

ScrollView objects should not be nested. In addition, ScrollView objects should not be nested with other controls that provide scrolling, such as CollectionView, ListView, and WebView.

The same is valid for nesting Telerik scrollable controls inside ScrollView: ListView, DataGrid, PDF Viewer, TreeView, DataForm etc. 

You can nest scrollable objects but this breaks the UI virtualization, and in general which object should scroll first, the inner or the outer scrollable control?

Regarding to the Grid Layout usage, definitive height or * height is okay. 

Regards,
Didi
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.

Tags
ListView
Asked by
Sean
Top achievements
Rank 2
Iron
Answers by
Didi
Telerik team
Share this question
or