[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Collapse]Common Concepts
  [Expand]Web.config Modifications
  [Expand]Callback Exception Handling
  [Expand]Client-Side Functionality
  [Expand]Cookies Support
  [Expand]Appearance Customization - Theming
   Icon Collection
  [Expand]Performance Optimization
  [Expand]CSS Image Sprites
   Supported Document Types
  [Expand]Accessibility Support
   Right to Left Support
   HTML Encoding
   Binary Storage Configuration
  [Expand]SharePoint Support
   Mobile Support
  [Collapse]Office Document Management
   [Collapse]Document Loading
     Opening Documents
     Sharing Documents
   [Expand]Document Saving
    Document Hibernation
   Cloud Storage Account Management
  [Expand]Web Farm and Web Garden Support
 [Expand]ASP.NET WebForms Controls
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Sharing Documents

The current approach implemented by DevExpress Office Controls for storing all open documents in server memory (in a list maintained by the DocumentManager) does not prevent scenarios in which the same document is opened by multiple browser clients at the same time.

These situations may occur in the following cases.

  • A document is opened from a common shared document folder on the server file system (this folder is specified using the WorkDirectory property of an office control). Multiple users open the same document file specified by its server path - its location within the shared folder.
    Document opening can be initiated through an office control's UI (via the File Open dialog) or using an API (via an Open method that accepts pathToDocument as a parameter).

  • Specify the DocumentId to open a document directly from the server’s in-memory storage of open documents (DocumentManager) by specifying the DocumentId.
    You can open a document through an API via an Open method that accepts IDocumentInfo as a parameter) – as demonstrated in the code snippet below.


    Note, that an office control’s Open method only receives the IDocumentInfo class's descendant that is cast for the specific type as a parameter (SpreadsheetDocumentInfo and RichEditDocumentInfo, respectively).

    If this code is called with the same DocumentId on behalf of different application users, actions performed by such users within the document will be applied to the same document on the server.

Currently, changes made by other users to the same document are not indicated in DevExpress office controls’ UI. End users may need to refresh the web page to see other user’s changes.

Document sharing may cover scenarios in which an end-user starts working with a document on one computer (for instance, a desktop) and then continues his/her work on another computer (such as a tablet). In this case, the user does not lose changes when switching betweendevices. Other scenarios such as collaboration or co-authoring can also lead to losing changes.

To learn more about document sharing, refer to the following Knowledge Base articles.

Expanded Prevent Document Sharing

There are times, however, when you need to disable document sharing (e.g., for security reasons) using the following approaches.

  • If documents are opened from the server's file system, specify different working folders (via the WorkDirectory property) for different users (user accounts).

  • If documents are opened from a custom document storage (e.g., a database), implement custom logic that will check and prevent requests from different users (user accounts) to a database document object with the same DocumentId.

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