如图,去掉该编辑器功能。

1、detailView

  protected override void OnActivated()
        {
            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页面的编辑器的更多相关文章

  1. ASP.NET MVC 学习3、Controller左手从Model获取数据,右手传递到View页面

    参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/accessing-your-models-dat ...

  2. 程氏CMS去掉静态页面的隐藏性版权方法

    程氏CMS去掉静态页面的隐藏性版权方法 实例如图: 因为之前自己找了好久都没找到这俩代码写在那个文件夹的,经过跟csqq8讨论了也没有得到结果,今天突然发现,原来这些代码都经过base64加密,用加密 ...

  3. MVC下 把数据库中的byte[]值保存成图片,并显示在view页面

    MVC下 把数据库中的byte[]值转成图片,并显示在view页面 controller中的action方法 //显示图片[AllowAnonymous]public ActionResult Sho ...

  4. struts2 - View页面中获取Action的成员变量

    struts2 - View页面中获取Action的成员变量 2016年03月02日 11:04:44 IT男青年 阅读数:1074   View页面中获取Action的成员变量 按照Struts的设 ...

  5. gridView在view页面中的一些代码详细模板

    <?php use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; use frontend\models\Item ...

  6. thinkphp中view页面中的volist标签转化为原生php分析(多去看源代码,你会发现不仅简单,方便你理解,还节约时间)

    thinkphp中view页面中的volist标签转化为原生php分析(多去看源代码,你会发现不仅简单,方便你理解,还节约时间) 一.总结 1.标签和原生php之间的关系:标签只是为了方便你使用,标签 ...

  7. Visual Studio中View页面与Js页面用快捷键互相跳转

    现在已经将源码放到GitHub中了 地址是 https://github.com/liningit/ViewJsLN 公司开发的项目使用的是Mvc框架,且Js与View页面是分开在两个文件夹下的,所以 ...

  8. View页面内容的旋转,在某些情况下可替代屏幕旋转使用

    这个是在做小秘书的体重曲线图的时候用到的,横排的时候可以多显示些内容,可是由于很多未知的冲突导至屏幕旋转起来非常麻烦,可用用旋转页面的内容来达到旋转屏幕的效果. 代码如下: //旋转90度 CGAff ...

  9. dedecms中如何去掉文章页面的广告

    在arcticle_arcticle.htm页面找到广告调用代码{dede:myad name='myad'/}全部去掉就好了,如果要换成自己的广告,就换广告位标识 myad 就可以了

随机推荐

  1. javascript使用两个逻辑非运算符(!!)的原因

    javascript使用两个逻辑非运算符(!!)的原因: 在有些代码中可能大家可能会注意到有些地方使用了两个逻辑非运算符,第一感觉就是没有必要,比如操作数是true的话,使用两个逻辑非的返回值还是tr ...

  2. AJAX回调(调用后台方法返回数据)

    记得先要导入jquery.js. 格式一 $.ajax({"Key1":"value1","key2":"value2" ...

  3. 在Apache中使用mod_rewrite模块重写URL

    如果有使用第三方框架做项目时,url路径是可以同过框架给的方法来设定的(如thinkphp),但如果使用原生php写的项目又想重写url,则可通过apache的一些设置来达到想要的效果. 在更改apa ...

  4. iPhone6的CSS3媒体查询

    @media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (orientation : po ...

  5. 关于web api 2 客户端请求Post

    (一).客户端的部分代码[需要添加NuGet程序包] 附:Client 声明方法 HttpClient client = new HttpClient(); client.BaseAddress = ...

  6. Hibernate的延迟加载

    我们会分析load和get两种加载方式: 一.load加载方式 当使用load方法来得到一个对象时,此时hibernate会使用延迟加载的机制来加载这个对象,即:当我们使用session.load() ...

  7. HTML5初学篇章_4

    HTML5的表单所有type类型(补第一章) 类型 说明 button 定义可点击的按钮(大多与 JavaScript 使用来启动脚本) checkbox 定义复选框. color 定义拾色器. da ...

  8. Linux常用命令(持续更新)

    lsb_release -a 查看linux操作系统信息 getconf LONG_BIT 查看linux操作系统位数 useradd [-g groupname] username 创建用户,并指定 ...

  9. IO 磁盘总结

    IO 磁盘 1.读取 首先引用一个using System.IO;引用空间其次 string ste= File.ReadAllText("E:\\bt.txt",Encoding ...

  10. 一个xib钟多个Cell

    在实际开发中,有时候需要在一个xib钟拖几个cell,注意连线过程的object选择,不然出现没反应的现象. 例如: 在下图中,我在一个xib钟创建了五个cell,他们分别是:收货地址.订单信息.支付 ...