Back to Devexpress

ShapeCollection Interface

officefileapi-devexpress-dot-spreadsheet-b99a775d.md

latest3.5 KB
Original Source

ShapeCollection Interface

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

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public interface ShapeCollection :
    ISimpleCollection<Shape>,
    IEnumerable<Shape>,
    IEnumerable,
    ICollection
vb
Public Interface ShapeCollection
    Inherits ISimpleCollection(Of Shape),
             IEnumerable(Of 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 ObjectMethod
ShapeShapeCollection.AddShape
Shape GroupShapeCollection.GroupShapes
Text BoxShapeCollection.AddTextBox
Shape ConnectorShapeCollection.AddConnector
PicturePictureCollection.AddPicture
ChartChartCollection.Add

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

See Also

ShapeCollection Members

Charts and Graphics in Spreadsheet Documents

DevExpress.Spreadsheet Namespace