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 就可以了
随机推荐
- POI操作Excel常用方法总结 (转)
以下的链接为原创地址: http://blog.csdn.net/huazhangena/article/details/7587731 http://blog.csdn.net/huazhangen ...
- Dependency Injection
Inversion of Control - Dependency Injection - Dependency Lookup loose coupling/maintainability/ late ...
- IE 9 以下兼容HTML5
<head> <meta name="viewport" content="width=device-width,initial-scale=1.0&q ...
- 安装redis,执行make test时遇到You need tcl 8.5 or newer in order to run the Redis test
安装他yum install tcl
- ThinkPHP留后门技巧
原文链接:https://www.leavesongs.com/PENETRATION/thinkphp-callback-backdoor.html 90sec上有人问,我说了还有小白不会用.去年我 ...
- Java面试题大全(四)
JAVA代码查错 1. abstract class Name { private String name; public abstract boolean isStupidName(String n ...
- java编程思想恶心的enum状态机示例
下面是一个包装输入的类 package test; import java.util.Random; public enum Input { NICKEL(5) , DIME(10) , QUARTE ...
- php课程---Ajax(老师详解)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- <script>元素的位置
脚本元素会组织下载网页内容,浏览器可以同时下载多个组件,但一旦遇到一个外部脚本文本后,浏览器会停止进一步下载,知道这个脚本文件下载,解析并执行完毕.这会严重影响网页载入的总时间,特别是在网页在入时会发 ...
- A trip through the Graphics Pipeline 2011_07_Z/Stencil processing, 3 different ways
In this installment, I’ll be talking about the (early) Z pipeline and how it interacts with rasteriz ...