Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [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]Localization
 [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]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[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 the server memory (in a list maintained by the DocumentManager) does not prevent situations when 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 already 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

    Note, that office controls' Open method receives as a parameter only the IDocumentInfo class's descendant that is cast for the specific type (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 the UI of DevExpress office controls. End users may need to refresh the web page to see other user’s changes.

In general, the current application of such document sharing may cover scenarios when an end-user starts working with a document on one computer (for instance, a desktop) and then continue his/her work on another computer (such as a tablet). In this case, a user does not lose changes while switching between devices guaranteed. Other scenarios including collaboration or co-autoring can lead 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 may 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?​​​​​​​