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.v14.2.dll
#Declaration
#Event Data
The InitNewElement event's handler receives an argument of the LayoutControlInitNewElementEventArgs type. 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 Customization mode 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.