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

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. [LintCode] Intersection of Two Arrays II 两个数组相交之二

    Given two arrays, write a function to compute their intersection.Notice Each element in the result s ...

  2. javascript特效--制作背景电子钟(整点时祝贺生日快乐)

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. emmet常用的输入

    开始体验:输入以下简写,按tab键 html:5 html:4t html:4s html:xxs ul#nav>li.itemS*4>a{Item $} <ul id=" ...

  4. HTML--JS练习小游戏(别踩白块儿)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. spring security LDAP获取用户信息

    很多企业内部使用LDAP保存用户信息,这章我们来看一下如何从LDAP中获取Spring Security所需的用户信息. 首先在pom.xml中添加ldap所需的依赖. <dependency& ...

  6. Android中layout_gravity和gravity的区别

    安卓中的 layout_gravity 属性和 gravity属性 有啥区别? LinearLayout有两个非常相似的属性: android:gravity与android:layout_gravi ...

  7. SRM 588 DIV1

    250 题意:有n首不同的曲子,你唱每首曲子需要花费a的时间以及一个调整的时间b,调整的时间为此首歌的曲调减去上一首歌的曲调的绝对值. 思路:我们用dp[i][k]表示前i首歌只唱k首用的最小时间花费 ...

  8. uilmit 优化

    #!/bin/bash sed -i "/^ulimit -SHn.*/d" /etc/rc.local echo "ulimit -SHn 102400" & ...

  9. php——用for循环打印半金字塔、金字塔、正方形、倒金字塔、菱形、空心图形等

    1.半金字塔 $n=5; //控制层数 for($i=1;$i<=$n;$i++){ //控制每层的 “*” 数 for($j=1;$j<=$i;$j++){ echo  "*& ...

  10. 转载:有关qsort的使用方法和注意事项

    七种qsort排序方法 <本文中排序都是采用的从小到大排序> 一.对int类型数组排序 int num[100]; Sample: int cmp ( const void *a , co ...