LayoutControl.InitNewElement Event

Allows you to customize properties of items created by an end-user at runtime in Customization Mode.

Namespace: DevExpress.Xpf.LayoutControl

Assembly: DevExpress.Xpf.LayoutControl.v20.1.dll

Declaration

public event EventHandler<LayoutControlInitNewElementEventArgs> InitNewElement
Public Event InitNewElement As EventHandler(Of LayoutControlInitNewElementEventArgs)

Event Data

The InitNewElement event's data class is LayoutControlInitNewElementEventArgs. The following properties provide information specific to this event:

Property Description
Element Gets the created layout element.

Remarks

An end-user can add new items (e.g. groups) in Customization Mode, provided that the LayoutControl.AllowNewItemsDuringCustomization and LayoutControl.AllowAvailableItemsDuringCustomization properties are set to true. See the LayoutControl.AllowNewItemsDuringCustomization topic to learn more.

The InitNewElement event fires after an item has been created by a user. Handle the event to customize the item's properties. The created item can be accessed via the event's Element parameter.

When saving/loading layouts to a data store, only properties that can be changed by an end-user during layout customization are stored/restored. If you need to save/load custom properties, handle the LayoutControl.WriteElementToXML and LayoutControl.ReadElementFromXML events.

See Also