This demo illustrates how to access diagram items on the client.
Specify the ClientInstanceName property to define a unique client identifier for the ASP.NET Diagram control (ASPxDiagram). Use this identifier on the client side to access a control instance programmatically.
In this demo, the Init event’s handler searches for a shape ("Greta Sims"), selects it, and scrolls the diagram view area to display the shape. Use the following diagram API to replicate similar behavior:
- The GetItems method returns a collection of diagram items.
- The SetSelectedItems method selects the specified items.
- The ScrollToItem method scrolls the view area to the specified item.
When a user selects or deselects diagram shapes, the SelectionChanged event is fired. Call the GetSelectedItems method in the event handler to obtain an array of selected items and display the text for selected shapes in the side panel.