[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Controllers and Actions
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]System Module
  [Collapse]Extra Modules
   [Expand]Audit Trail Module
    Business Class Library Customization Module
    Chart Module
    Clone Object Module
   [Expand]Conditional Appearance Module
   [Expand]Dashboards Module
    File Attachments Module
    HTML Property Editor Module
    Localization Module
   [Expand]Notifications Module
    KPI Module
   [Expand]Maps Module
   [Expand]Pivot Chart Module
    Pivot Grid Module
   [Expand]Reports V2 Module
   [Expand]Office Module
   [Expand]Scheduler Module
    Script Recorder Module
   [Expand]State Machine Module
   [Expand]TreeList Editors Module
   [Expand]Validation Module
    View Variants Module
   [Expand]Workflow Module
  [Expand]Debugging, Testing and Error Handling
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Clone Object Module

The Clone Object module allows end-users to quickly create similar objects by cloning them, and changing the required properties. For this purpose, this module provides a View Controller that contains the CloneObject Action. When executing this Action, the required object is cloned. This topic details this Action's default behavior and provides information on available customizations.


Currently, we do not to provide built-in support for Entity Framework (EF) in this module, because its implementation heavily depends on our XPO ORM, and we do not have a sufficient number of customer requests in this regard. If you use EF for data access in your XAF application and require a similar functionality for your project, feel free to contact us and describe your business requirements so we can provide you with alternative solutions. In general, you can integrate any custom or standard solution for Entity Framework, which you would implement to solve the same requirement in non-XAF applications. We will also continue monitoring user demand in this regard and it is possible that we will review our current decision in the future.

Expanded Clone Object Module Overview

The Clone Object module consists of a single assembly: DevExpress.ExpressApp.CloneObject.v19.1.dll. So, you can add the CloneObjectModule to the common application module to use its CloneObject Action in WinForms and ASP.NET applications. For this purpose, invoke the Module Designer and drag the CloneObject module from the Toolbox to the RequiredModules panel. If you need to add this module to an application project, invoke the Application Designer and drag the CloneObject module from the Toolbox's XAF Modules page to the Modules panel on the Designer. Rebuild your solution after adding the module.


The Clone Object module supplies the CloneObjectViewController View Controller. This Controller contains the CloneObject Single Choice Action, targeted for cloning the currently selected object. In addition, the CloneObject module extends the Application Model's BOModel | <Class> nodes with the IModelClassCloneable.IsCloneable property. Set it to true, to enable cloning of class objects.

The CloneObject Action is activated for Views representing an object type whose BOModel | <Class> node's IsCloneable property is set to true. This Action enables you to create a clone of the current object as an object of the current type. In addition, you can create an object of a class inherited from the current object's base class. For this purpose, set the base class' IsCloneable property to true. By default, the CloneObject Action is disabled when there are unsaved changes in the current object, because the clone process works in a separate Object Space. The following image demonstrates the CloneObject Action activated for the Contact class. The Action's dropdown list contains the Contact type, because the IsCloneable property is set to true for the Person class - the base class for the Contact.

To specify that a particular field or property cannot be cloned, apply the NonCloneableAttribute to it.


The CloneObject Action's Items collection does not include object types that are prohibited for the current user by the Security System.

Expanded Clone Object Module Customization

To edit the settings of the CloneObjectViewController or the CloneObject Action, use the Application Model's ActionDesign | Actions | CloneObject or ActionDesign | Controllers | DevExpress.ExpressApp.CloneObject.CloneObjectViewController nodes. These nodes are available in the Model Editor when the CloneObject module is added.

To change the behavior of the CloneObjectViewController or CloneObjectAction, create a custom View Controller, and access the Controller and its Action in the Controller.Activated event handler. Refer to the CloneObjectViewController.CloneObjectAction topic, to see an example. Additionally, you can handle events exposed by the CloneObjectViewController class.

Expanded See Also

Is this topic helpful?​​​​​​​