文档章节

How to set spreadsheetControl's Protect as DocumentProtectionType.AllowComments ?

麦壳饼
 麦壳饼
发布于 2017/05/15 00:49
字数 192
阅读 20
收藏 0

richEditControl just like this         richEditControl1.Document.Protect("",  DevExpress.XtraRichEdit.API.Native.DocumentProtectionType.AllowComments); 

   But spreadsheetControl can't  
  spreadsheetControl1.Document.Protect("", DevExpress.XtraRichEdit.API.Native.DocumentProtectionType.AllowComments);      spreadsheetControl 

 

 

Yulia (DevExpress Support)6 days ago

  •  
  •  
  •  

Hello,

The Worksheet.Protect method provides a set of available actions to be restricted, similar to the ones specified by the "Protect Sheet" dialog in MS Office Excel. So, the SpreadsheetControl does not provide a special option to allow only editing comments in a document. Please refer to the Protection help topic to learn more regarding the SpreadsheetControl's Protection feature. 

To achieve the goal, you can call the Worksheet.Protect method and allow the SelectLockedCells,  SelectUnlockedCells and Objects actions. The Objects parameter also allows editing charts and pictures in the document. If you wish to prohibit these actions, set DocumentCapabilities.Charts and DocumentCapabilities.Pictures to DocumentCapability.Disabled (see the attached video).

Here is a sample code snippet that demonstrates this approach:

 

[C#]Open in popup window

private void CustomProtect() { spreadsheetControl.Options.DocumentCapabilities.Charts = DocumentCapability.Disabled; spreadsheetControl.Options.DocumentCapabilities.Pictures = DocumentCapability.Disabled; spreadsheetControl.ActiveWorksheet.Protect("123", WorksheetProtectionPermissions.Default | WorksheetProtectionPermissions.Objects); } private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { CustomProtect(); }

Note that it will be necessary to enable the DocumentCapabilities.Charts and DocumentCapabilities.Pictures properties manually after a worksheet becomes unprotected. 

2017-05-09_1245.swf

© 著作权归作者所有

麦壳饼

麦壳饼

粉丝 22
博文 72
码字总数 4828
作品 7
昌平
高级程序员
私信 提问
Cross Site Request Forgery protection

The CSRF middleware and template tag provides easy-to-use protection against Cross Site Request Forgeries. This type of attack occurs when a malicious Web site contains a link, ......

岭南六少
2011/08/21
0
0
MinTTY 0.9.4 发布,终端模拟器

MinTTY 是一款专用于 Cygwin 环境的终端模拟器,它兼容于 Xterm,支持 UTF-8、CJK 字体、Windows 输入法,可执行拖曳和复制/粘贴操作,具有原生的 Windows 外观及窗口透明等特性。 MinTTY 基...

红薯
2010/12/19
494
0
使用Formik轻松开发更高质量的React表单(二)使用指南

基础 Imagine you want to build a form that lets you edit user data. However, your user API has nested objects like so. When we are done we want our dialog to accept just a user,......

googlingman
2018/07/29
0
0
CodeIgniter 更新和插入数据库时的进行数据转义

一、解决方法:1 插入数据时,使用CodeIgniterd的Active Record模式的set方法,set()接受可选的第三个参数$escape,如果此参数被设置为FALSE,就可以阻止数据被转义,该参数的默认值是TRUE2 更...

雪之丞
2014/09/16
0
0
[Fibre Channle 实战之三]FC 和iSCSI的使用差异

Fibre Channel 和iSCSI是我们导出块存储设备给initiator的最常见两种方式,深入理解通过这两种通道建立target、后端存储、ACL、探测target、连接和断开target、实现fail-over的差异,是我们统...

存储之厨
2017/06/28
0
0

没有更多内容

加载失败,请刷新页面

加载更多

抽象同步队列AQS——AbstractQueuedSynchronizer锁详解

AQS——锁的底层支持 谈到并发,不得不谈ReentrantLock;而谈到ReentrantLock,不得不谈AbstractQueuedSynchronizer(AQS)! 类如其名,抽象的队列式的同步器,AQS定义了一套多线程访问共享资...

须臾之余
今天
2
0
springboot配置百度UEditor 富文本详解

富文本简介 UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码... 准备工作 ueditor需要单独文...

wotrd
昨天
3
0
mysql 5.7之my.cnf配置大全

[client]port = 3306socket = /tmp/mysql.sock[mysqld]###############################基础设置######################################Mysql服务的唯一编号 每个mysql服务...

Online_Reus
昨天
2
0
MAVEN打包时引入外部链接的包

1.项目引入了ORACLE的jar包,MAVEN配置如下 2.打jar包的时候需要指定下main入口函数mainClass <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> ......

Cobbage
昨天
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部