XAF去掉View页面的编辑器



如图,去掉该编辑器功能。
1、detailView
{
base.OnActivated();
// Perform various tasks depending on the target View.
foreach (IntegerPropertyEditor propertyEditor in View.GetItems<IntegerPropertyEditor>()) {
propertyEditor.ControlCreated += new EventHandler<EventArgs>(propertyEditor_ControlCreated);
}
}
void propertyEditor_ControlCreated(object sender, EventArgs e)
{
SpinEdit spinEdit = ((IntegerPropertyEditor)sender).Control;
spinEdit.Properties.Buttons[spinEdit.Properties.SpinButtonIndex].Visible = false;
spinEdit.Properties.AllowMouseWheel = false;
}
2、listView
protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target View.
//if (View is DetailView)
//{
// foreach (DXPropertyEditor editor in ((DetailView)View).GetItems<DXPropertyEditor>())
// {
// editor.ControlCreated += new EventHandler<EventArgs>(editor_ControlCreated);
// }
//}
if (View is ListView)
{
((ListView)View).Editor.ControlsCreated += new EventHandler(listEditor_ControlsCreated);
}
}
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
void listEditor_ControlsCreated(object sender, EventArgs e)
{
ListEditor editor = (ListEditor)sender;
editor.ControlsCreated -= new EventHandler(listEditor_ControlsCreated);
GridListEditor gridListEditor = editor as GridListEditor;
if (gridListEditor == null || gridListEditor.GridView == null) return;
gridListEditor.GridView.ShownEditor += new EventHandler(GridView_ShownEditor);
}
void GridView_ShownEditor(object sender, EventArgs e)
{
CustomizeEditor(((XafGridView)sender).ActiveEditor);
}
void editor_ControlCreated(object sender, EventArgs e)
{
DXPropertyEditor editor = (DXPropertyEditor)sender;
editor.ControlCreated -= new EventHandler<EventArgs>(editor_ControlCreated);
CustomizeEditor(editor.Control);
}
private void CustomizeEditor(DevExpress.XtraEditors.BaseEdit baseEdit)
{
// baseEdit.Properties.AllowMouseWheel = false;
baseEdit.Properties.AllowMouseWheel = false;
DevExpress.XtraEditors.TextEdit textEdit = baseEdit as DevExpress.XtraEditors.TextEdit;
if (textEdit == null) return;
textEdit.Spin += (object sender2, DevExpress.XtraEditors.Controls.SpinEventArgs e) => { e.Handled = true; };
}
XAF去掉View页面的编辑器的更多相关文章
- ASP.NET MVC 学习3、Controller左手从Model获取数据,右手传递到View页面
参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/accessing-your-models-dat ...
- 程氏CMS去掉静态页面的隐藏性版权方法
程氏CMS去掉静态页面的隐藏性版权方法 实例如图: 因为之前自己找了好久都没找到这俩代码写在那个文件夹的,经过跟csqq8讨论了也没有得到结果,今天突然发现,原来这些代码都经过base64加密,用加密 ...
- MVC下 把数据库中的byte[]值保存成图片,并显示在view页面
MVC下 把数据库中的byte[]值转成图片,并显示在view页面 controller中的action方法 //显示图片[AllowAnonymous]public ActionResult Sho ...
- struts2 - View页面中获取Action的成员变量
struts2 - View页面中获取Action的成员变量 2016年03月02日 11:04:44 IT男青年 阅读数:1074 View页面中获取Action的成员变量 按照Struts的设 ...
- gridView在view页面中的一些代码详细模板
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; use frontend\models\Item ...
- thinkphp中view页面中的volist标签转化为原生php分析(多去看源代码,你会发现不仅简单,方便你理解,还节约时间)
thinkphp中view页面中的volist标签转化为原生php分析(多去看源代码,你会发现不仅简单,方便你理解,还节约时间) 一.总结 1.标签和原生php之间的关系:标签只是为了方便你使用,标签 ...
- Visual Studio中View页面与Js页面用快捷键互相跳转
现在已经将源码放到GitHub中了 地址是 https://github.com/liningit/ViewJsLN 公司开发的项目使用的是Mvc框架,且Js与View页面是分开在两个文件夹下的,所以 ...
- View页面内容的旋转,在某些情况下可替代屏幕旋转使用
这个是在做小秘书的体重曲线图的时候用到的,横排的时候可以多显示些内容,可是由于很多未知的冲突导至屏幕旋转起来非常麻烦,可用用旋转页面的内容来达到旋转屏幕的效果. 代码如下: //旋转90度 CGAff ...
- dedecms中如何去掉文章页面的广告
在arcticle_arcticle.htm页面找到广告调用代码{dede:myad name='myad'/}全部去掉就好了,如果要换成自己的广告,就换广告位标识 myad 就可以了
随机推荐
- 1071. Speech Patterns (25)
People often have a preference among synonyms of the same word. For example, some may prefer "t ...
- Java_Eclipse_Maven环境搭建
一.Maven下载 地址:http://maven.apache.org/download.cgi 二.配置仓库及环境变量(以D:\maven为例) 1> 解压文件至D:\maven 2> ...
- java二叉树的实现和遍历
/* * Java实现二叉树 */ public class BinaryTree { int treeNode; BinaryTree leftTree; BinaryTree rightTree; ...
- Centos 安装了 Wkhtmltopdf 却依旧显示 无法打印pdf
Odoo里判断wkhtmlpdf是否安装的代码在 openerp/tools/misc.py 文件中: def find_in_path(name): path = os.environ.get('P ...
- 概率论与数理统计ppt链接
http://e-learning.ecust.edu.cn/G2S/Template/View.aspx?courseId=26835&topMenuId=72352&action= ...
- 记录下ECharts的一些功能
用到ECharts记录下一些功能免得以后找文档找不到. 这个博客对ECharts讲解很全面 http://www.stepday.com/my.stepday/?echarts // 使用 requi ...
- SpringMvc简单实例
Spring MVC应用一般包括4个步骤: (1)配置web.xml,指定业务层对应的spring配置文件,定义DispatcherServlet; (2)编写处理请求的控制器 (3)编写视图对象,例 ...
- EL表达式Expression Language
表达式语言Expression Language目的:简化jsp代码 EL内置对象 1.pageContext2.pageScope3.requestScope4.sessionScope5.appl ...
- .htaccess 重写去index.php
.htaccess 重写去index.php <IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{REQUEST_FILENAME} ...
- Git的常用操作
$ git log //查看commit记录 $ git add <file> //添加文件到commit中 .代表所有改动的文件 $ git commit -m 'meesage' // ...