Back to Devexpress

LayoutControl.InitNewElement Event

wpf-devexpress-dot-xpf-dot-layoutcontrol-dot-layoutcontrol-6ffca1de.md

latest3.4 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.LayoutControl

Declaration

csharp
public event EventHandler<LayoutControlInitNewElementEventArgs> InitNewElement
vb
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:

PropertyDescription
ElementGets 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

AllowAvailableItemsDuringCustomization

AllowNewItemsDuringCustomization

WriteElementToXML

ReadElementFromXML

Save and Restore Item Layout

LayoutControl Class

LayoutControl Members

DevExpress.Xpf.LayoutControl Namespace