RayCraftDocs
v1.0.3 raycraft.dev
On this page

VirtualList

Free

A scrolling list that draws only the rows in view, for hundreds of thousands of items. Rows have a fixed height (a row template can have several lines); the keyboard reaches every row. Rows can come from the server in windows, several rows can be selected and dragged onto a TreeView.

Example

VirtualList control

Parameters

ParameterTypeDescription
ClassstringExtra CSS classes added to the root element.
DraggableboolLets rows be dragged; the payload goes to IRayCraftDrag (VirtualList).
DragPayloadFunc<IReadOnlyList<TItem>, Object>Builds the drag payload from the rows being dragged (default: the list of rows).
HeightstringHeight of the list, for example 24rem (default 16rem); the list scrolls inside it.
ItemBoldFunc<TItem, bool>Tells whether the text of an item is bold, for example when it is unread.
ItemClassFunc<TItem, string>Adds CSS classes to a row (VirtualList).
ItemHeightintHeight of one row in pixels (default 36). All rows have the same height.
ItemKeyFunc<TItem, Object>Returns a stable key per item, so selection and open details survive reloads.
ItemsIEnumerable<TItem>The items to show.
ItemsProviderFunc<VirtualListRequest, Task<VirtualListResult<TItem>>>Loads rows from a server: gets the start row, the count and a cancellation token and returns the rows with the total count (VirtualList; Autocomplete has its own provider).
ItemTemplateRenderFragment<TItem>Custom content for each item. The item is available as context.
ItemTextFunc<TItem, string>Converts an item to its display text (defaults to ToString()).
LabelstringVisible label text (charts: accessible name; IconButton: accessible name and tooltip).
MultipleboolAllows several selected rows: click, Ctrl+click, Shift+click, Shift+arrows, Ctrl+A (VirtualList).
SelectableboolLets rows be selected (default true).
SelectedItemTItemSelected item. Use with @bind-SelectedItem.
SelectedItemsIReadOnlyList<TItem>Selected rows. Use with @bind-SelectedItems.
ShowDragHandleboolShows a grip at the start of a row and drags only by the grip (VirtualList).
StylestringInline style added to the root element.

Events

EventTypeDescription
OnLoadErrorEventCallback<Exception>Raised with the exception when ItemsProvider fails to load rows.
SelectedItemChangedEventCallback<TItem>Raised when another item is selected.
SelectedItemsChangedEventCallback<IReadOnlyList<TItem>>Raised when the selection changes.

Package

VirtualList is part of RayCraft Free. Package: RayCraft.Blazor. It comes from nuget.org. See Getting started.