using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text; using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using DevExpress.ExpressApp.Win.Editors;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Columns;
using DevExpress.Utils.Menu;
using DevExpress.XtraGrid.Menu;
using System.Drawing;
using DevExpress.ExpressApp.Utils; namespace E1554.Module
{
public partial class FixclomunViewController : ViewController<ListView>
{
public FixclomunViewController()
{
InitializeComponent(); } protected override void OnDeactivated()
{
base.OnDeactivated();
} protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
GridListEditor listEditor = ((ListView)View).Editor as GridListEditor;
if (listEditor != null)
{
XafGridView gridView = listEditor.GridView as XafGridView;
gridView.PopupMenuShowing += new PopupMenuShowingEventHandler(gridView_PopupMenuShowing);
} }
private void gridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
{
if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
{
DevExpress.XtraGrid.Menu.GridViewColumnMenu menu = e.Menu as GridViewColumnMenu; if (menu.Column != null)
{ //Adding new items
DXPopupMenu popMenu = new DXPopupMenu();
popMenu.Caption = "凍結列";
menu.Items.Add(popMenu); popMenu.Items.Add(CreateCheckItem("取消", menu.Column, FixedStyle.None,
ImageLoader.Instance.GetImageInfo("NotFixed").Image));
popMenu.Items.Add(CreateCheckItem("左側", menu.Column, FixedStyle.Left,
ImageLoader.Instance.GetImageInfo("FixedLeft").Image));
popMenu.Items.Add(CreateCheckItem("右側", menu.Column, FixedStyle.Right,
ImageLoader.Instance.GetImageInfo("FixedRight").Image));
} }
} //Create a menu item
DXMenuCheckItem CreateCheckItem(string caption, GridColumn column, FixedStyle style, Image image)
{
DXMenuCheckItem item = new DXMenuCheckItem(caption, column.Fixed == style,
image, new EventHandler(OnFixedClick));
item.Tag = new MenuInfo(column, style);
return item;
} //Menu item click handler
void OnFixedClick(object sender, EventArgs e)
{
DXMenuItem item = sender as DXMenuItem;
MenuInfo info = item.Tag as MenuInfo;
if (info == null) return;
info.Column.Fixed = info.Style;
} //The class that stores menu specific information
class MenuInfo
{
public MenuInfo(GridColumn column, FixedStyle style)
{
this.Column = column;
this.Style = style;
}
public FixedStyle Style;
public GridColumn Column;
}
}
}

[原] XAF ListView 凍結列的更多相关文章

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

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

  2. [WPF]ListView点击列头排序功能实现

    [转]   [WPF]ListView点击列头排序功能实现 这是一个非常常见的功能,要求也很简单,在Column Header上显示一个小三角表示表示现在是在哪个Header上的正序还是倒序就可以了. ...

  3. [原] XAF 如何启用ListView Top N records 提升用户使用体验

    為了提升用戶使用體驗,特擴展此功能(來源與Xafari Framework).1.可在模型編輯器中設置是否啓用,默認啓用.2.DataAccessMode為Client模式才啓用.其它模式自動關閉.3 ...

  4. [原] XAF 如何啟用ListView橫向滾動條

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

  5. [原] XAF How to bind a stored procedure to a ListView in XAF

    First, I suggest that you review the following topic to learn how to show a custom set of objects in ...

  6. [原] XAF How to Edit multiple objects in a ListViewAndDetailView

    2014年好久没有更新Blog了,工作调换了,很少用XAF,但还是很关注XAF的发展和学习,对中国的中小企业数据管理软件开发真的太实用了!! 功能比较简单,但很实用,直接上图和代码! ListView ...

  7. 【原】sql 将某列拼成一个字符串

    SQL Server中,写存储过程,时常会碰到这样一个需求:从某个表中取某一列,然后需要将这一列数据以某种形式拼成一个字符串,以供后面使用,下面这种方法能够实现此需求. --取说明书模块枚举,结果格式 ...

  8. C# ListView点击列头进行排序

    /// <summary> /// This class is an implementation of the 'IComparer' interface. /// </summa ...

  9. [原] XAF 添加日期筛选下拉选择

    1.ListView 添加日期筛选下拉选择,选择指定,可指定日期范围 2.Code using DevExpress.Data.Filtering; using DevExpress.ExpressA ...

随机推荐

  1. 事务BEGIN TRANSACTION

    事务(Transaction)是并发控制的基本单位.所谓的事务,它是一个操作序列,这些操作要么都执行,要么都不执行,它是一个不可分割的工作单位.例如,银行转账工作:从一个账号扣款并使另一个账号增款,这 ...

  2. Android进程间的通信之AIDL

    Android服务被设计用来执行很多操作,比如说,可以执行运行时间长的耗时操作,比较耗时的网络操作,甚至是在一个单独进程中的永不会结束的操作.实现这些操作之一是通过Android接口定义语言(AIDL ...

  3. XHTML标签的嵌套规则分析

    在 XHTML 的语言里,我们都知道:ul 标签包含着 li.dl 标签包含着 dt 和 dd——这些固定标签的嵌套规则十分明确.但是,还有许多标签是独立的,它们没有被捆绑在一起,比如 h1.div. ...

  4. git & scp

    git & scp command : git & scp git git 提交 git checkout/pull =====[在提交前校验远程是否有冲突] git add [< ...

  5. CentOS 6.5升级Python和安装IPython

    <转自:http://www.noanylove.com/2014/10/centos-6-5-sheng-ji-python-he-an-zhuang-ipython/>自己常用.以做备 ...

  6. 金蝶K/3 Cloud 界面解析过程

    服务端 目前也就是iis服务器生成Json描述返回给不同的展现端最解析. 不同的展现端,可以有Silverlight.WPF.Html5.Winform 当然还有IOS和Android端做解析展现 对 ...

  7. AngularJs自定义指令详解(6) - controller、require

    在前面文章中提到一旦声明了require,则链接函数具有第四个参数:controller. 可见require和controller是配合使用的. 在自定义指令中使用controller,目的往往是要 ...

  8. Zabbix(一)--zabbix 2.4.8 安装

    zabbix依赖于LAMP,所以部署前要先保证这个平台. 安装服务端(Server) zabbix官网的rpm包都是按照功能分开一个个,比如: zabbix-server-2.4.7-1.el7.x8 ...

  9. URAL 1992 CVS 可持久化链栈

    http://www.cnblogs.com/tedzhao/archive/2008/11/12/1332112.html 看这篇的链表部分的介绍应该就能理解“可持久化”了 动态分配内存的会T,只能 ...

  10. 如何查看SharePoint未知错误的详细信息

    在sharepoint 开发的时候,需要查看具体的sharepoint报错信息需要在配置文件中配置如下 通过下面方法就可以直接在出错页面查看错误信息.修改Web应用程序根目录上的Web.config文 ...