Skip to main content
A newer version of this page is available. .

SpreadsheetControl.SelectedShape Property

Gets or sets a shape selected in the active worksheet.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v19.1.dll

Declaration

[Browsable(false)]
public Shape SelectedShape { get; set; }

Property Value

Type Description
Shape

A Shape object. If you assign a shape located in a worksheet that is not active, an exception is raised.

Remarks

All shapes in a worksheet are contained in the ShapeCollection, accessible via the Worksheet.Shapes property. Use the SelectedShape property to specify a shape selected in the active worksheet. Images embedded in a worksheet expose the Picture interface which descends from the Shape. So, to specify a picture selected in the active worksheet, you can use the SpreadsheetControl.SelectedPicture property as well as SelectedShape.

You can also select multiple shapes in the worksheet simultaneously. To get or set a list of shapes selected in the active worksheet, use the SpreadsheetControl.GetSelectedShapes or SpreadsheetControl.SetSelectedShapes method.

To select shapes in a specific worksheet of the document loaded in the SpreadsheetControl, use the Worksheet.SelectedPicture, Worksheet.SelectedShape, Worksheet.SetSelectedShapes and Worksheet.GetSelectedShapes members of the corresponding worksheet object.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectedShape property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also