XAF ListView 移除顶部工具栏
此方法适用于C/S及B/S,无需分别写在web和win中。
Module下新建ViewController,代码如下:
public partial class GongZuoJiaoShen_YinCangGongJuLan : ViewController<DetailView>
{
public GongZuoJiaoShen_YinCangGongJuLan()
{
InitializeComponent();
// Target required Views (via the TargetXXX properties) and create their Actions.
} protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target View.
//取消记录表的工具栏
foreach (ListPropertyEditor detailPropertyEditor in View.GetItems<ListPropertyEditor>())
{
if (detailPropertyEditor.Id == "JiaoShenJiLu")
detailPropertyEditor.ControlCreated += new EventHandler<EventArgs>(detailPropertyEditor_ControlCreated);
}
} /// <summary>
/// 取消记录表的工具栏
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void detailPropertyEditor_ControlCreated(object sender, EventArgs e)
{
Frame nestedFrame = ((ListPropertyEditor)sender).Frame;
if (nestedFrame != null && nestedFrame.Template is ISupportActionsToolbarVisibility)
{
((ISupportActionsToolbarVisibility)nestedFrame.Template).SetVisible(false);
}
} 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(); foreach (ListPropertyEditor detailPropertyEditor in View.GetItems<ListPropertyEditor>())
{
if (detailPropertyEditor.Id == "JiaoShenJiLu")
detailPropertyEditor.ControlCreated -= new EventHandler<EventArgs>(detailPropertyEditor_ControlCreated);
}
}
}
注意:VC的TargetType要设置,否则就是全局的了。
效果图:

XAF ListView 移除顶部工具栏的更多相关文章
- 自定义底部工具栏及顶部工具栏和Fragment配合使用demo
首先简单的介绍下fragment,fragment是android3.0新增的概念,其中文意思是碎片,它与activity非常相似,用来在一个activity中描述一些行为或一部分用户界面.使用锁个f ...
- Windows Phone 8.1开发:如何让ListView滚动到顶部,回到第一条?
Windows Phone 8.1开发中,ListView向下滑动了半天,用户如果突然想回头看看第一条数据怎么办? 如何让listView滚动到顶部,回到第一条? 很简单,一行代码.调用ListVie ...
- android listview滚动到顶部
1.为了实现类似IOS点击状态栏,列表回滚到顶部的功能(要平滑滚动效果),android上点击一个按钮或是图片什么的也可以让listview一次性滚动到顶部(滑动太多页时,一次可能滚不到顶部,使用ha ...
- [原] XAF ListView 凍結列
using System; using System.ComponentModel; using System.Collections.Generic; using System.Diagnostic ...
- [原] XAF ListView显示隐藏Footer菜单
using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...
- ListView 滚回顶部
setSelection(0) listView.setSelectionAfterHeaderView(); list.smoothScrollToPosition(0);
- ListView滚动到顶部
videoAdapter.notifyDataSetChanged();videoListView.setSelection(0); 注意顺序先notify后setSelection
- 孙鑫C++教程留下来的作业--如何让工具栏在原来隐藏的位置出现
--加油,不仅仅是口号! BEGIN---------------------------------- 将工具栏进行停靠.当隐藏后再次点击出现的时候它出现在工具栏顶部了,并没有停靠在原来的位置,如何 ...
- 滑动listview隐藏和显示顶部布局
需求: 1.listview向下滑动时,隐藏顶部布局 2.listview向上滑动到最上面,显示顶部布局 3.顶部布局的隐藏和显示有过渡效果 4.第一次加载listview时,顶部不要隐藏 布局: 注 ...
随机推荐
- Linux驱动学习之常用的模块操作命令
1.常用的模块操作命令 (1)lsmod(list module,将模块列表显示),功能是打印出当前内核中已经安装的模块列表 (2)insmod(install module,安装模块),功能是向当前 ...
- 使用SVN时出现的文件缺失问题
使用SVN的童鞋们,可能有三种提交代码的方法: 第一种使用客户端(例如SVNX,CornerStone): 第二种使用Xcode提交(Source Control -> commit): 第三种 ...
- 安卓app中嵌入一个H5页面,当手机系统设置字体变大时,如何使H5页面的字体不会随用户自己调整的系统字体变化而变化?
webview.getSettings().setTextZoom(100);WebView加上这个设置后,WebView里的字体就不会随系统字体大小设置发生变化了. https://segmentf ...
- centos 常见软件安装
centos虚拟机扩展硬盘空间 http://www.cnblogs.com/sixiweb/p/3360008.html http://blog.csdn.net/remote_roamer/art ...
- 读取xml文件报错:Invalid byte 2 of 2-byte UTF-8 sequence。
程序读取xml文件后,系统报“Invalid byte 2 of 2-byte UTF-8 sequence”错误,如何解决呢? 1.程序解析xml的时候,出现Invalid byte 2 of 2- ...
- C++中数据对齐
大体看了看数据对齐,不知道是否正确,总结如下: struct A { char name; double dHeight; int age; }; sizeof(A) = (1+7+8+4+4) = ...
- UIView中间透明周围半透明(四种方法)
方法一 #import "DrawView.h" @implementation DrawView - (instancetype)initWithFrame:(CGRect)fr ...
- CentOS 6.5升级Python和安装IPython
<转自:http://www.noanylove.com/2014/10/centos-6-5-sheng-ji-python-he-an-zhuang-ipython/>自己常用.以做备 ...
- c#输出、输入
//输出 Console.WriteLine("这是一行文字"); 自动回车的. Console.Write("Hello world"); 不带回车的. ...
- 数学对象-Math
Math 属性: PI 圆周率 例子:var x=Math.xxxx(); sqrt() 一个非负数的平方根 nan pow() x的y次幂的值 Math.pow( ...