NavigationSelectionChangedEventArgs<TInfo>.SelectedItems Property
Returns a collection of currently selected items.
Namespace: DevExpress.Blazor.Base
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public IReadOnlyList<TInfo> SelectedItems { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<TInfo> | Currently selected items. |
Remarks
The following code snippet gets previously and currently
selected items:
<DxAccordion SelectionMode="NavigationSelectionMode.Single"
SelectionChanged="@OnSelectionChanged">
<Items>
<DxAccordionItem Text="Shapes">
<Items>
<DxAccordionItem Text="Circle" />
<DxAccordionItem Text="Square" />
</Items>
</DxAccordionItem>
<DxAccordionItem Text="Templates" />
</Items>
</DxAccordion>
Selected item: @SelectedItem
<br /> Deselected item: @DeselectedItem
@code {
string SelectedItem { get; set; }
string DeselectedItem { get; set; }
void OnSelectionChanged(AccordionSelectionChangedEventArgs e) {
SelectedItem = e.SelectedItems.FirstOrDefault()?.Text;
DeselectedItem = e.DeselectedItems.FirstOrDefault()?.Text;
}
}
See Also