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.
C# |
var documentId = GetSharedDocumentId();
var documentInfo = (SpreadsheetDocumentInfo)DocumentManager.FindDocument(documentId);
ASPxSpreadsheet1.Open(documentInfo);
|
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.

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.