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. windows与linux之间文件的传输方式总结(转)

    当然,windows与linux之间文件的传输的两种方式有很多,这里就仅仅列出工作中遇到的,作为笔记: 方法一:安装SSH Secure Shell Client客户端 安装即可登录直接拖拉到linu ...

  2. deep learning on object detection

    回归工作一周,忙的头晕,看了两三篇文章,主要在写各种文档和走各种办事流程了-- 这次来写写object detection最近看的三篇文章吧.都不是最近的文章,但是是今年的文章,我也想借此让自己赶快熟 ...

  3. Sublime text 3 中Package Control 的安装与使用方法和解决Sublime Text 3不能正确显示中文的问题

    Sublime text 3 中Package Control 的安装与使用方法,英文好可以在这个网址看看, 下面简单的说明一下 : https://packagecontrol.io/install ...

  4. spark2.0配置

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  5. Spring事务管理(转)

    1 初步理解 理解事务之前,先讲一个你日常生活中最常干的事:取钱. 比如你去ATM机取1000块钱,大体有两个步骤:首先输入密码金额,银行卡扣掉1000元钱:然后ATM出1000元钱.这两个步骤必须是 ...

  6. gulp LiveReload middleware

    用yo搭建的angular项目,用gulp自动化构建. 自动化构建主要的功能大致有: 1. 文件压缩 2. 文件重命名 3. 文件合并 4. css,js文件自动引入到html 5. 自动刷新 ... ...

  7. Amoeba+Mysql实现数据库读写分离

    一.Amoeba 是什么 Amoeba(变形虫)项目,专注 分布式数据库 proxy 开发.座落与Client.DB Server(s)之间.对客户端透明.具有负载均衡.高可用性.sql过滤.读写分离 ...

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

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

  9. sql月份销售统计

    1.SELECT   MONTH(SellTime) as selltime,SUM(TotalPrice) as total FROM  Sell WHERE  YEAR(SellTime)=CON ...

  10. 摘记 pyinstaller 使用自定义 spec

    下面的是官网的文档, 我们可以用自定义spec的方式把想要的文件打包到目标文件夹里面 例如: 我们在程序中用了一个图标 test.ico, 如果我们只用 pyinstaller -w test.py ...