Back to Devexpress

SvgImageBox.Selection Property

windowsforms-devexpress-dot-xtraeditors-dot-svgimagebox-482f8f14.md

latest3.1 KB
Original Source

SvgImageBox.Selection Property

Provides access to the currently selected items.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[Browsable(false)]
public SvgImageSelection Selection { get; }
vb
<Browsable(False)>
Public ReadOnly Property Selection As SvgImageSelection

Property Value

TypeDescription
SvgImageSelection

A collection of selected items.

|

Remarks

Use the SvgImageBox.OptionsSelection.SelectionMode property to choose item selection mode (single or multiple).

The SvgImageBox.Selection property allows you to access the currently selected item(s). Use the SvgImageBox.Select SvgImageBox.Unselect and SvgImageItem.Selected members to select/deselect items in code.

Handle the SvgImageBox.SelectionChanging and SvgImageBox.SelectionChanged events to perform actions when a user selects/deselects items. The SvgImageBox.SelectionChanging event allows you to prevent individual image items from being selected.

Example

The following code locates and selects an item by its ID (SvgImageItem.Id).

csharp
var item1 = svgImageBox1.FindItemById("seat_12");
svgImageBox1.Selection.Add(item1);
vb
Dim item1 = svgImageBox1.FindItemById("seat_12")
svgImageBox1.Selection.Add(item1)

See Also

SelectionChanging

SelectionChanged

Select(SvgImageItem)

Unselect(SvgImageItem)

Selected

SvgImageBox Class

SvgImageBox Members

DevExpress.XtraEditors Namespace