此方法适用于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 移除顶部工具栏的更多相关文章

  1. 自定义底部工具栏及顶部工具栏和Fragment配合使用demo

    首先简单的介绍下fragment,fragment是android3.0新增的概念,其中文意思是碎片,它与activity非常相似,用来在一个activity中描述一些行为或一部分用户界面.使用锁个f ...

  2. Windows Phone 8.1开发:如何让ListView滚动到顶部,回到第一条?

    Windows Phone 8.1开发中,ListView向下滑动了半天,用户如果突然想回头看看第一条数据怎么办? 如何让listView滚动到顶部,回到第一条? 很简单,一行代码.调用ListVie ...

  3. android listview滚动到顶部

    1.为了实现类似IOS点击状态栏,列表回滚到顶部的功能(要平滑滚动效果),android上点击一个按钮或是图片什么的也可以让listview一次性滚动到顶部(滑动太多页时,一次可能滚不到顶部,使用ha ...

  4. [原] XAF ListView 凍結列

    using System; using System.ComponentModel; using System.Collections.Generic; using System.Diagnostic ...

  5. [原] XAF ListView显示隐藏Footer菜单

    using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...

  6. ListView 滚回顶部

    setSelection(0) listView.setSelectionAfterHeaderView(); list.smoothScrollToPosition(0);

  7. ListView滚动到顶部

    videoAdapter.notifyDataSetChanged();videoListView.setSelection(0); 注意顺序先notify后setSelection

  8. 孙鑫C++教程留下来的作业--如何让工具栏在原来隐藏的位置出现

    --加油,不仅仅是口号! BEGIN---------------------------------- 将工具栏进行停靠.当隐藏后再次点击出现的时候它出现在工具栏顶部了,并没有停靠在原来的位置,如何 ...

  9. 滑动listview隐藏和显示顶部布局

    需求: 1.listview向下滑动时,隐藏顶部布局 2.listview向上滑动到最上面,显示顶部布局 3.顶部布局的隐藏和显示有过渡效果 4.第一次加载listview时,顶部不要隐藏 布局: 注 ...

随机推荐

  1. 循序渐进Python3(八) -- 1 -- socket进阶

    IO多路复用 I/O多路复用指:通过一种机制,可以监视多个描述符,一旦某个描述符就绪(一般是读就绪或者写就绪),能够通知程序进行相应的读写操作. Linux中的 select,poll,epoll 都 ...

  2. android 设置状态栏与标题背景颜色一致

    必须在Android4.4以上版本才能设置状态栏颜色: 一.在单个Activity里面,设置状态栏的背景: 效果: 1.在Activity的布局根文件中添加属性: android:fitsSystem ...

  3. C# 模拟键盘操作--SendKey(),SendKeys()

    模拟键盘输入就是使用以下2个语法实现的.SendKeys.Send(string keys);  //模拟汉字(文本)输入SendKeys.SendWait(string keys); //模拟按键输 ...

  4. npm -v 一直闪

    一直闪一般是配置搞错了 参考: windows安装完nodejs后做了相关环境变量配置后,cmd输入npm没反应啊 就光标一直闪 node是正常的 或者 https://segmentfault.co ...

  5. 利用target的特性,可以实现纯css的tab效果切换

    基础知识: :target起作用的是href连接到的位置 如 <a href="#tab1">tab1</a> <div id="tab1& ...

  6. (转)提高mysql千万级大数据SQL查询优化30条经验(Mysql索引优化注意)

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 ...

  7. 调用别人提供的WebService

    在开发过程中,许多时候需要使用到别人提供的WebService接口,使用其中的方法. 在调用别人提供的接口时,会得到接口使用的文档,其中包括接口的网络地址及方法作用等. 找到WebService的ws ...

  8. SQL Server创建复合索引时,复合索引列顺序对查询的性能影响

    说说复合索引 写索引的博客太多了,一直不想动手写,有一下两个原因:一是觉得有炒剩饭的嫌疑,有兄弟曾说:索引吗,只要在查询条件上建索引就行了,真的可以这么暴力吗?二来觉得,索引是个非常大的话题,很难概括 ...

  9. yum安装出错

    [root@lxh yum.repos.d]# yum install -y samba Loaded plugins: fastestmirror, refresh-packagekit, secu ...

  10. TreeMap的使用

    Map<Integer, String> map = new TreeMap<Integer, String>();//TreeMap本身具有排序功能(默认按键升序排序) ma ...