VirtualList
FreeA 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

Parameters
| Parameter | Type | Description |
|---|---|---|
Class | string | Extra CSS classes added to the root element. |
Draggable | bool | Lets rows be dragged; the payload goes to IRayCraftDrag (VirtualList). |
DragPayload | Func<IReadOnlyList<TItem>, Object> | Builds the drag payload from the rows being dragged (default: the list of rows). |
Height | string | Height of the list, for example 24rem (default 16rem); the list scrolls inside it. |
ItemBold | Func<TItem, bool> | Tells whether the text of an item is bold, for example when it is unread. |
ItemClass | Func<TItem, string> | Adds CSS classes to a row (VirtualList). |
ItemHeight | int | Height of one row in pixels (default 36). All rows have the same height. |
ItemKey | Func<TItem, Object> | Returns a stable key per item, so selection and open details survive reloads. |
Items | IEnumerable<TItem> | The items to show. |
ItemsProvider | Func<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). |
ItemTemplate | RenderFragment<TItem> | Custom content for each item. The item is available as context. |
ItemText | Func<TItem, string> | Converts an item to its display text (defaults to ToString()). |
Label | string | Visible label text (charts: accessible name; IconButton: accessible name and tooltip). |
Multiple | bool | Allows several selected rows: click, Ctrl+click, Shift+click, Shift+arrows, Ctrl+A (VirtualList). |
Selectable | bool | Lets rows be selected (default true). |
SelectedItem | TItem | Selected item. Use with @bind-SelectedItem. |
SelectedItems | IReadOnlyList<TItem> | Selected rows. Use with @bind-SelectedItems. |
ShowDragHandle | bool | Shows a grip at the start of a row and drags only by the grip (VirtualList). |
Style | string | Inline style added to the root element. |
Events
| Event | Type | Description |
|---|---|---|
OnLoadError | EventCallback<Exception> | Raised with the exception when ItemsProvider fails to load rows. |
SelectedItemChanged | EventCallback<TItem> | Raised when another item is selected. |
SelectedItemsChanged | EventCallback<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.
Send feedbackVersion 1.0.3