Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ShapeCollection Interface

A collection of drawing objects (shapes, pictures, and charts).

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public interface ShapeCollection :
    ISimpleCollection<Shape>,
    IEnumerable<Shape>,
    IEnumerable,
    ICollection

The following members return ShapeCollection objects:

#Remarks

The Worksheet.Shapes property returns a ShapeCollection object. This collection contains the standalone drawing objects and shape groups. It stores each group as a single shape and does not include individual elements that form this group. Use a group’s Shape.GetChildren method to obtain its items. If you want to retrieve all drawing objects from a worksheet, including items of shape groups, use the Flatten() method.

The ShapeCollection.GetShapesByName method enables you to get all drawing objects with the specified name. To find a drawing object by its unique ID, use the ShapeCollection.GetShapeById method.

The table below lists the supported drawing object types and methods used to create them:

Drawing Object Method
Shape ShapeCollection.AddShape
Shape Group ShapeCollection.GroupShapes
Text Box ShapeCollection.AddTextBox
Shape Connector ShapeCollection.AddConnector
Picture PictureCollection.AddPicture
Chart ChartCollection.Add

Use the Shape.ShapeType property to determine a drawing object’s type in the ShapeCollection collection.

See Also