Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

NuGet Package: DevExpress.Wpf.LayoutControl

#Declaration

#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