Skip to main content
All docs
V22.1

ASPxClientDiagram.GetSelectedItems Method

Returns an array of selected diagram items.

Declaration

GetSelectedItems(): DiagramItem[]

Returns

Type Description
DiagramItem[]

An array of items (shapes and connectors).

Remarks

The code sample below displays a list of selected items with text in the console.

<dx:ASPxDiagram ID="Diagram" runat="server" ClientInstanceName="diagram" />
<!-- other code -->
</dx:ASPxDiagram>
var items = diagram.GetSelectedItems();
var text = 'Selected items:';
for (var item of items)
    if (item.text != undefined)
        text = text + '\n' + item.text;
console.log(text);
See Also