Occurs before a control is created for the current View Item.
public event EventHandler<EventArgs> ControlCreating
Public Event ControlCreating As EventHandler(Of EventArgs)
The ControlCreating event's data class is EventArgs.
A View Item represents a non-visual entity that contains a certain functionality related to an item in a Detail View. To be represented in a UI, a control is created for it. This event is raised as a result of calling the ViewItem.CreateControl method of the current View Item. Handle it, to perform custom actions before a control is created.
To customize the control after it has been created, handle the ViewItem.ControlCreated event.
By default, View Items’ controls are initialized immediately, when a View is created. This behavior ensures that you can rely on the View.ControlsCreated and ViewController.ViewControlsCreated events when accessing a View Item’s control. The downside is that this behavior is slower. You can change this behavior, to speed up creation of complex Views, by setting the XafApplication.DelayedViewItemsInitialization property to true. This will ensure that View Items’ controls are initialized only when they are visible to end-users. However, in this instance you can no longer rely on the View.ControlsCreated and ViewController.ViewControlsCreated events alone and should additionally ensure that your code is not accessing View Items’ controls before they are created. For additional information, refer to the XafApplication.DelayedViewItemsInitialization property description.