Skip to main content
A newer version of this page is available. .
All docs
V21.1

ASPxClientDiagram.ScrollToItem(item) Method

Scrolls the view area to the specified item.

Declaration

ScrollToItem(
    item: DiagramItem
): void

Parameters

Name Type Description
item DiagramItem

A diagram item (shape or connector).

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