Skip to main content
.NET Standard 2.0+

ViewItem Class

Represents a base class for View Items.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v22.1.dll

Declaration

public abstract class ViewItem :
    IDisposable

Remarks

The ViewItem class implements basic functionality for items that can be contained in a Detail View. This functionality includes:

To access the Detail View in which a View Item is contained, use the ViewItem.View property.

The eXpressApp Framework ships with the following descendants of the ViewItem class:

To implement a custom View Item, inherit from the ViewItem class. The following protected members that are not described in the documentation can be overridden:

Member Description
CreateControlCore Called by the ViewItem.CreateControl method. You should return the control that will represent your View Item in a UI.
SaveModelCore Called by the ViewItem.SaveModel method. You can override it to save the settings of a View Item and its control to the Application Model. This allows display of the View Item in the same manner as it was before it was recreated.
Dispose Called by the ViewItem.Dispose method. Override it if you need to dispose custom allocated resources.
OnCurrentObjectChanging and OnCurrentObjectChanged Called when the ViewItem.CurrentObject property is changed.
OnControlCreating and OnControlCreated Called when a control (see ViewItem.Control) is created. Raise the ViewItem.ControlCreating and ViewItem.ControlCreated events.

Note

A custom View Item should be implemented in a platform-specific module project and decorated with the ViewItemAttribute. If your solution does not contain this project, add this View Item to an application project. This View Item will be loaded to the Application Model, which means that you will be able to use it in a UI.

For details on View Items and basics on how to implement custom ones, refer to the View Items and How to: Implement a View Item topics.

To access a View Item of the View for which a Controller is activated, handle the Controller.Activated and ViewItem.ControlCreated events, as it is demonstrated in the Access Editor Settings tutorial.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ViewItem class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also