WMListViewDetails
Description
This component renders the Details view of a Gap.Blazor.ListView
using a virtualized Telerik Grid
. It supports dynamic columns, checkbox selection, and real-time updates to the grid based on changes in the underlying model. The component is optimized for performance with virtual scrolling and dynamic data binding.
Usage
Properties
ListViewModel: Instance of the
Gap.Blazor.ListView
model.telerikGrid: Reference to the Telerik
Grid
component.DataAdapter: Adapter that transforms
ListViewItem
data into a format compatible with Telerik Grid.
Methods
OnInitialized(): Subscribes to model events for item and subitem changes.
OnDataRead(GridReadEventArgs): Handles virtual scrolling and paging by returning a
DataSourceResult
from the adapter.selectionChangeHandler(): Maps selected grid row to the corresponding
ListViewItem
and triggersListViewItemClickAction
andSelectedIndexChanged
.Items_AfterAdd / AfterInsert / BeforeRemove / AfterClear: Synchronize grid data with model changes.
UpdateSubItem(): Updates a specific cell in the grid when a subitem changes.
RecallOnChange_Data(): Forces the grid to refresh its state.
GetItemCheckedValue(index): Returns the checked state of a
ListViewItem
.OnItemCheckBoxValueChanged(value, index): Updates the checked state of a
ListViewItem
.
Dynamic Rendering
GridColumns: Dynamically generated based on
listViewModel.Columns
.Checkbox Column: Conditionally rendered if
CheckBoxes
is enabled.Virtual Scrolling: Enabled via
ScrollMode="Virtual"
andOnRead
.
Styles
Events
Items Collection Events:
AfterAdd
,AfterInsert
,BeforeRemove
,AfterClear
SubItem Updates:
UpdateSubItem
Selection Events:
SelectedItemsChanged
,ListViewItemClickAction
,SelectedIndexChanged
Last updated