The requested page is not available for the requested platform. You are viewing the content for Default platform.

XafApplication.ViewCreating Event

Occurs when creating a View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.1.dll

Declaration

public event EventHandler<ViewCreatingEventArgs> ViewCreating
Public Event ViewCreating As EventHandler(Of ViewCreatingEventArgs)

Event Data

The ViewCreating event handler receives an argument of the ViewCreatingEventArgs type. The following properties provide information specific to this event.

Property Description
IsRoot Indicates whether a root View must be created.
ObjectSpace Returns the Object Space to be used when creating a new View.
View Specifies a custom View created in a XafApplication.DetailViewCreating or XafApplication.ListViewCreating event.
ViewID Returns the ID of the created View.

Remarks

Handle this event to provide a custom View instead of a default one. Use the handler's ViewCreatingEventArgs.View parameter to get information on the View being created. To do this, use the application's XafApplication.FindModelView method passing the View ID as a parameter.

To specify the Detail View's current object use the handler's DetailViewCreatingEventArgs.Obj parameter. Create the Detail View in the Object Space passed as the handler's ViewCreatingEventArgs.ObjectSpace parameter.

To create a List View, use the collection source passed as the handler's ListViewCreatingEventArgs.CollectionSource parameter. To specify whether the List View is root, use the handler's ViewCreatingEventArgs.IsRoot parameter.

See Also