Class DataCollectionState<TItem>
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.dll
Maintains the state for data collection components including pagination, filtering, sorting, and selection.
public sealed class DataCollectionState<TItem>
Type Parameters
TItemThe type of the items in the collection.
- Inheritance
-
objectDataCollectionState<TItem>
Constructors
DataCollectionState()
public DataCollectionState()
Properties
CurrentPage
The current page number.
public int CurrentPage { get; set; }
Property Value
- int
FilterText
The current filter text.
public string FilterText { get; set; }
Property Value
- string
PageSize
The number of items displayed per page.
public int PageSize { get; set; }
Property Value
- int
SelectedItems
The set of currently selected items.
public IReadOnlySet<TItem> SelectedItems { get; }
Property Value
- IReadOnlySet<TItem>
SortColumn
The name of the column currently used for sorting.
public string? SortColumn { get; set; }
Property Value
- string
SortDirection
The current sort direction.
public SortDirection SortDirection { get; set; }
Property Value
Methods
ClearSelection()
Clears all selected items.
public void ClearSelection()
IsSelected(TItem)
Determines whether the specified item is selected.
public bool IsSelected(TItem item)
Parameters
itemTItemThe item to check.
Returns
ResetPagination()
Resets the current page to the first page.
public void ResetPagination()
SelectAll(IEnumerable<TItem>)
Selects all items in the specified collection.
public void SelectAll(IEnumerable<TItem> items)
Parameters
itemsIEnumerable<TItem>The items to select.
SelectItem(TItem, SelectionMode)
Toggles the selection state of the specified item.
public void SelectItem(TItem item, SelectionMode mode)
Parameters
itemTItemThe item to toggle.
modeSelectionModeThe selection mode.
ToggleSort(string)
Toggles the sort direction for the specified column.
public void ToggleSort(string columnName)
Parameters
columnNamestringThe name of the column to sort.