The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

Shape Interface

A common interface for drawing objects in a worksheet.

Namespace: DevExpress.Spreadsheet

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

Declaration

public interface Shape :
    FloatingObject,
    ShapeFormatBase
Public Interface Shape
    Inherits FloatingObject,
             ShapeFormatBase
public interface Shape :
    FloatingObject,
    ShapeFormatBase
Public Interface Shape
    Inherits FloatingObject,
             ShapeFormatBase
public interface Shape :
    FloatingObject,
    ShapeFormatBase
Public Interface Shape
    Inherits FloatingObject,
             ShapeFormatBase

Remarks

The Worksheet.Shapes property returns the ShapeCollection containing all Shape objects in a worksheet. You can get a drawing object by its ID or name using the ShapeCollection.GetShapeById or ShapeCollection.GetShapesByName method, respectively.

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

The drawing object's position can be determined using the FloatingObject.Top and FloatingObject.Left properties, which get the distance from the top and left edges of the worksheet. You can also use the FloatingObject.TopLeftCell property to determine the cell under the top left corner of the drawing object, and then get the FloatingObject.OffsetX and FloatingObject.OffsetY values to determine the position of the object's top left corner within that cell.

You can freely move and rotate a drawing object using the FloatingObject.Move and Shape.IncrementRotation methods.

To delete a drawing object, use the ShapeCollection.RemoveAt or Shape.Delete method.

See Also