public void UnGroupElements( IEnumerable<GroupElement> groups )
Public Sub UnGroupElements( _ ByVal groups As IEnumerable(Of GroupElement) _ )
Parameters
- groups
- The group elements whose elements are to be ungrouped
public void UnGroupElements( IEnumerable<GroupElement> groups )
Public Sub UnGroupElements( _ ByVal groups As IEnumerable(Of GroupElement) _ )
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
System.ArgumentException | groups cannot be null or empty |
System.ArgumentException | elements must belong to layout 'URI' |
System.ArgumentException | element parents must be the same and non-null |
var selectedElements = layout.GetSelectedElements().ToList(); if (selectedElements?.Any() == false)//must be at least 1. return; var elementsToUnGroup = new List<GroupElement>(); //All selected elements should be grouped elements. if (selectedElements.Count() == selectedElements.OfType<GroupElement>().Count()) { //Convert to a GroupElement list. elementsToUnGroup = selectedElements.ConvertAll(x => (GroupElement)x); } if (elementsToUnGroup.Count() == 0) return; //UnGroup many grouped elements layout.UnGroupElements(elementsToUnGroup); //Ungroup one grouped element layout.UnGroupElement(elementsToUnGroup.FirstOrDefault());
Target Platforms: Windows 11, Windows 10, Windows 8.1