Skip to content

Commit f9f8498

Browse files
kb(listView): item selection
1 parent 29e0246 commit f9f8498

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

knowledge-base/listview-selection.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: ListView Selection
3+
description: How to select items in the ListView and get Selected event
4+
type: how-to
5+
page_title: ListView Selection
6+
slug: listview-kb-selection
7+
position:
8+
tags:
9+
ticketid: 1491528
10+
res_type: kb
11+
---
12+
13+
## Environment
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product</td>
18+
<td>ListView for Blazor</td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
23+
24+
## Description
25+
I want to know if there is a Selected Event in the listview so When a user click on a item I can do something.
26+
27+
I want to highlight (same as the Grid Selection Mode) the selected item in ListView control and raise the SelectedItemChanged event. How to achieve this is ListView control.
28+
29+
## Solution
30+
The ListView does not own the item rendering, this is entirely up to the application and the item templates. Thus, the listview cannot select the items because it cannot own their events, rendering and add an appropriate CSS class to denote selection.
31+
32+
The solution is to implement the selection in the templates and the model with your own code. The following sample project shows one way to do it: [https://github.com/telerik/blazor-ui/tree/master/listview/item-selection](https://github.com/telerik/blazor-ui/tree/master/listview/item-selection)

0 commit comments

Comments
 (0)