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时,顶部不要隐藏 布局: 注 ...
随机推荐
- 水果姐逛水果街Ⅱ codevs 3305
3305 水果姐逛水果街Ⅱ 时间限制: 2 s 空间限制: 256000 KB 题目描述 Description 水果姐第二天心情也很不错,又来逛水果街. 突然,cgh又出现了.cgh施展了魔 ...
- python install_opener用法
opener:当你获取一个URL时,你使用一个opener(OpenerDirector).正常情况下我们一直使用默认的opener,通过urlopen,但你也可以创建自定义的openers. url ...
- 循序渐进Python3(十)-- 0 -- RabbitMQ
RabbitMQ RabbitMQ是一个由erlang开发的AMQP(Advanced Message Queue )的开源实现.AMQP 的出现其实也是应了广大人民群众的需求,虽然在同步消息 ...
- C#中关于异步的三种写法
1 投票 IAsyncResult ar = d1.BeginInvoke(1, 3000, null, null); while (!ar.IsCompleted) class Program { ...
- keepalived+nginx高可用负载均衡环境搭建
上篇说道keepalived的环境搭建,本来keepalived结合lvs更有优势,但是也可以结合nginx来使用.下面接着说下nginx的环境搭建 环境信息: nginx(master) 192. ...
- 足球游戏AI_资料收集
实况足球中文官网 浅谈足球游戏的人工智能 用遗传算法加强足球游戏的人工智能 足球规则图解 守门员的技巧你知道吗? 教你足球守门员守门技术练习方法和技巧 足球守门员规则 判断点球方向
- UIWebView、WKWebView使用详解及性能分析
http://www.cnblogs.com/junhuawang/p/5759224.html
- Unbunt vi 编辑器键盘按键不正确的一次经历与解决方案
在 VMWare 上安装了 Ubuntu Server 14.04.1(这个默认没有安装 vim ) 我在配置网卡的时候,编辑得很心碎.键盘输入和平常vi的响应完全不一样.又不能用 SecureCRT ...
- IntelliJ IDEA 2016.2激活方法
IntelliJ IDEA 2016.2激活 激活码 43B4A73YYJ-> eyJsaWNlbnNlSWQiOiI0M0I0QTczWVlKIiwibGljZW5zZWVOYW1lIjoib ...
- ASP.NET MVC3 Model验证总结
ASP.NET MVC3中的Model是自验证的,这是通过.NET4的System.ComponentModel.DataAnnotations命名空间完成的. 我们要做的只是给Model类的各属性加 ...