Skip to main content

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

GroupShapeCollection.Ungroup() Method

Splits a group into individual shapes.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#Declaration

#Returns

Type Description
IEnumerable<DrawingObject>

A collection of shapes retrieved from the group.

#Remarks

The Ungroup method does not split nested groups into separate shapes. Call this method for each group individually.

The example below shows how to split all shape groups in the document (including nested groups):

using System.Linq;
// ...

Document document = wordProcessor.Document;
List<DrawingObject> groups = document.Shapes.Flatten()
    .Where(x => x.Type == ShapeType.Group)
    .ToList();
for (int i = groups.Count - 1; i >= 0; i--)
{
    groups[i].GroupItems.Ungroup();
}
See Also