-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Reporting
-
Interaction
-
Report Types
-
Data binding
-
Real-life Reports
-
Layout Features
-
Report Controls
-
Web-specific Features
-
-
Rich Text Editor
- Overview
- Load/Save
- Document Protection
-
Templates
- Autocorrect
-
Customization
- Simple View
-
Spreadsheet
- Overview
-
Open a Document
- Export And Printing
-
Features
-
UI Customization
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Related Demos:
Your search did not match any results.
Rich Edit - Document Protection
Our ASP.NET Rich Text Editor allows users to open and view protected documents. It also allows you to identify the current user, and enable a permitted range for a specified user or group.
In this demo, the Review ribbon tab contains custom commands that allow users to protect and unprotect the document (use the password "123"), switch between users to edit different text ranges, and customize or disable highlighting. The document includes permitted ranges for four users identified by user name: each user is authorized to edit a separate text region. The enabled range for the current user is highlighted.
Ribbon commands use the following APIs to execute appropriate actions:
- protect and unprotect methods allow you to enable and disable document protection.
- The authenticationOptions property authenticates the current user by name or user group name.
- The rangePermissionOptions define visualization settings used to highlight permitted ranges.
Was this demo helpful?
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Backend API
<script src="~/DemosScripts/documentProtection.js"></script>
@(Html.DevExpress().RichEdit("DemoRichEdit")
.Open("Documents/DocumentProtection.docx")
.Ribbon(r => r
.Tabs(tabs => {
tabs.Add("Review")
.Items(items => {
items.AddButton()
.Text("Protect Document")
.CommandName("protectDocument")
.ShowText(true)
.Icon("dxre-icon-ProtectDocument");
items.AddButton()
.Text("Unprotect Document")
.CommandName("unprotectDocument")
.ShowText(true)
.Icon("dxre-icon-UnprotectDocument");
items.AddSelectBox()
.Width(280)
.BeginGroup(true)
.CommandName("user")
.Value("lawyer@somecompany.com")
.ShowClearButton(true)
.Placeholder("Select user")
.Items(i => i
.Add("lawyer@somecompany.com", "lawyer@somecompany.com")
.Add("projectmanager@somecompany.com", "projectmanager@somecompany.com")
.Add("senior@somecompany.com", "senior@somecompany.com")
.Add("novice@somecompany.com", "novice@somecompany.com")
);
items.AddToggleButton(true)
.BeginGroup(true)
.CommandName("highlightRanges")
.Text("Highlight Ranges");
items.AddColorBox()
.CommandName("highlightColor")
.Color("rgb(150, 200, 150)");
items.AddToggleButton(true)
.BeginGroup(true)
.CommandName("showBrackets")
.Text("Show Brackets");
items.AddColorBox()
.CommandName("bracketsColor")
.Color("rgb(127, 127, 127)");
});
})
.ActiveTabIndex(7)
)
.OnDocumentLoaded("onDocumentLoaded")
.OnCustomCommandExecuted("onCustomCommandExecuted")
.Authentication(a => a.UserName("lawyer@somecompany.com"))
.Height(600)
.ConfirmOnLosingChanges(c => c.Enabled(false))
)
using Microsoft.AspNetCore.Mvc;
namespace AspNetCoreDemos.RichEdit {
[Route("[action]")]
public class RichEditController : Controller {
public IActionResult DocumentProtection() {
return View();
}
}
}
var protectDocumentCommandId = 'protectDocument';
var unprotectDocumentCommandId = 'unprotectDocument';
function onCustomCommandExecuted(s, e) {
switch (e.commandName) {
case protectDocumentCommandId:
if (!s.document.isProtected) {
const password = window.prompt('enter new password(optional):', '');
if (password != undefined && password != null)
s.document.protect(password);
}
updateCommandsState(s);
break;
case unprotectDocumentCommandId:
const password = window.prompt('enter password:', '');
if (password != undefined && password != null) {
if (s.document.checkProtectionPassword(password))
s.document.unprotect();
else
window.alert('The password incorrect!');
}
updateCommandsState(s);
break;
case 'user':
s.authenticationOptions.userName = e.parameter;
break;
case 'highlightRanges':
s.rangePermissionOptions.highlightRanges = e.parameter;
break;
case 'showBrackets':
s.rangePermissionOptions.showBrackets = e.parameter;
break;
case 'highlightColor':
s.rangePermissionOptions.highlightColor = e.parameter;
break;
case 'bracketsColor':
s.rangePermissionOptions.bracketsColor = e.parameter;
break;
}
}
function onDocumentLoaded(s, e) {
updateCommandsState(s);
}
function updateCommandsState(rich) {
rich.setCommandEnabled(protectDocumentCommandId, !rich.document.isProtected);
rich.setCommandEnabled(unprotectDocumentCommandId, rich.document.isProtected);
}