Skip to main content
All docs
V25.1
  • ASPxClientDiagram.SetSelectedItems(items) Method

    Selects the specified items.

    Declaration

    SetSelectedItems(
        items: DiagramItem[]
    ): void

    Parameters

    Name Type Description
    items DiagramItem[]

    An array of items to select.

    Remarks

    The code sample below demonstrates how to select an item by text and scroll the view area to this item.

    <dx:ASPxDiagram ID="Diagram" runat="server" ClientInstanceName="diagram" />
    <!-- other code -->
    </dx:ASPxDiagram>
    
    var items = diagram.GetItems();
    for (var item of items)
      if (item.text == 'Development'){
        diagram.SetSelectedItems([item]);
        diagram.ScrollToItem(item);
        break;
      }
    
    See Also