The event handler receives an argument of type BeforeGroupPosChangedEventArgs containing data related to this event. The following BeforeGroupPosChangedEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | |
GroupHeaders | groups (read-only) |
GroupPosChangedType | group position changed type (read-only) |
The action argument indicates which action will occur to the group or groups: moving, swapping, or sizing.
The groups argument returns a reference to a Groups collection that can be used to retrieve references to the UltraGridGroup object or objects that will be moved, swapped, or sized. You can use this reference to access any of the returned collection's properties or methods, as well as the properties or methods of the objects within the collection. However, all properties of the affected groups are read-only in this event procedure.
The cancel argument enables you to programmatically prevent the group or groups from being moved, swapped, or sized. This argument can be used to prevent the user from moving, swapping, or sizing groups unless a certain condition is met. To prevent the user from attempting to move or swap a group, set the AllowGroupMoving or AllowGroupSwapping properties, respectively.
This event is generated before one or more groups are moved, swapped, or sized, either programmatically, or by user interaction. A group can be sized programmatically by setting its Width property and can be moved programmatically by setting its header's VisiblePosition property.
The VisiblePosition property can be used to determine both the current and new positions of the group or groups that will be moved or swapped. New positions can be determined by reading the property off of the header of the group or groups in groups, while current positions can be determined by reading the property off of the header of the group or group in the appropriate band.
The BeforeColPosChanged event is generated before one or more columns are moved, swapped, or sized.
The AfterGroupPosChanged event, which occurs after one or more groups are moved, swapped, or sized, is generated after this event, provided cancel is not set to True.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2