Class ListViewLayout
Defines the base for the layouts.
Namespace: Syncfusion.Maui.ListView
Assembly: Syncfusion.Maui.ListView.dll
Syntax
public abstract class ListViewLayout : BindableObject
Constructors
ListViewLayout()
Declaration
protected ListViewLayout()
Properties
ItemsCacheLimit
Gets or sets the cache limit for create and reuse the ListViewItems if different templates are used in Microsoft.Maui.Controls.DataTemplateSelector for better scrolling performance.
Declaration
public int ItemsCacheLimit { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
Based on this value, SfListView creates the number of ListViewItems for different templates in the view and if new template is created while scrolling and reuse it if same template is used for improving the scrolling performance.
Methods
ScrollToRowIndex(Int32, ScrollToPosition, Boolean)
Scrolls the SfListView to the row at the given index.
Declaration
public void ScrollToRowIndex(int rowIndex, ScrollToPosition scrollToPosition, bool animated = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The index of the row to scroll. |
Microsoft.Maui.Controls.ScrollToPosition | scrollToPosition | Defines position in the view to which row index is scrolled. |
System.Boolean | animated | false to disable scroll animation while changing the view; otherwise, true. The default is false. |
Remarks
When AutoFitMode is Height or DynamicHeight, scroll animation will be disabled by default in android and iOS. If it is called while loading SfListView, then set animated as true to scroll to appropriate row index, else view doesn't scrolled in android.
Examples
SfListView listView = new SfListView();
int index = listView.DataSource.DisplayItems.IndexOf(viewModel.Customers[2]);
listView.ItemsLayout.ScrollToRowIndex(index, ScrollToPosition.MakeVisible , true);
ScrollToRowIndex(Int32, Boolean)
Scrolls the SfListView to the row at the given index.
Declaration
public void ScrollToRowIndex(int rowIndex, bool animated = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The index of the row to scroll. |
System.Boolean | animated | false to disable scroll animation while changing the view; otherwise, true. The default is false. |
Remarks
When AutoFitMode is Height or DynamicHeight, scroll animation will be disabled by default in android and iOS. If it is called while loading SfListView, then set animated as true to scroll to appropriate row index, else view doesn't scrolled in android.
Examples
SfListView listView = new SfListView();
int index = listView.DataSource.DisplayItems.IndexOf(viewModel.Customers[2]);
listView.ItemsLayout.ScrollToRowIndex(index, true);