Skip to main content
.NET Framework 4.6.2+

ViewItem.Control Property

Returns the current View Item’s control displayed in a UI.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public object Control { get; }

Property Value

Type Description
Object

An object that is the current View Item’s control displayed in a UI.

Remarks

The Control property gets the control the CreateControlCore method returns. Handle the ViewItem.ControlCreating and/or ViewItem.ControlCreated event(s) to execute a custom functionality when this control is created.

When a View is created, all its View Item controls are initialized immediately by default. This behavior ensures that you can rely on the View.ControlsCreated and ViewController.ViewControlsCreated events when accessing a View Item’s control. However, complex Views with many controls may take a long time to open. To speed up this process, set the XafApplication.DelayedViewItemsInitialization property to true. This ensures that only controls visible to end-users, initialize. Note, that in this instance, you should make sure that your code is not accessing View Items’ controls before they are created, because you can no longer rely on the View.ControlsCreated and ViewController.ViewControlsCreated events alone. For additional information, refer to the XafApplication.DelayedViewItemsInitialization property description.

See Also