[原] XAF ListView 凍結列

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 凍結列的更多相关文章
- [原] XAF ListView显示隐藏Footer菜单
using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...
- [WPF]ListView点击列头排序功能实现
[转] [WPF]ListView点击列头排序功能实现 这是一个非常常见的功能,要求也很简单,在Column Header上显示一个小三角表示表示现在是在哪个Header上的正序还是倒序就可以了. ...
- [原] XAF 如何启用ListView Top N records 提升用户使用体验
為了提升用戶使用體驗,特擴展此功能(來源與Xafari Framework).1.可在模型編輯器中設置是否啓用,默認啓用.2.DataAccessMode為Client模式才啓用.其它模式自動關閉.3 ...
- [原] XAF 如何啟用ListView橫向滾動條
using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...
- [原] 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 ...
- [原] XAF How to Edit multiple objects in a ListViewAndDetailView
2014年好久没有更新Blog了,工作调换了,很少用XAF,但还是很关注XAF的发展和学习,对中国的中小企业数据管理软件开发真的太实用了!! 功能比较简单,但很实用,直接上图和代码! ListView ...
- 【原】sql 将某列拼成一个字符串
SQL Server中,写存储过程,时常会碰到这样一个需求:从某个表中取某一列,然后需要将这一列数据以某种形式拼成一个字符串,以供后面使用,下面这种方法能够实现此需求. --取说明书模块枚举,结果格式 ...
- C# ListView点击列头进行排序
/// <summary> /// This class is an implementation of the 'IComparer' interface. /// </summa ...
- [原] XAF 添加日期筛选下拉选择
1.ListView 添加日期筛选下拉选择,选择指定,可指定日期范围 2.Code using DevExpress.Data.Filtering; using DevExpress.ExpressA ...
随机推荐
- 游戏中的人工智能——初探AI
一.游戏中的人工智能 让游戏具有挑战性: 让游戏好玩的关键因素是为之找到合适的难度等级: 人工智能在游戏中的作用是通过提供富有挑战性的竞争对象来让游戏更好玩,而在游戏中行动逼真的非玩家角色(NPC), ...
- 转载:align
1. 原理 int a; int size = 8; <----> 1000(bin)计算a以size为倍数的下界数: 就让这个数(要计算的这个数)表示成二 ...
- 炫酷CSS
<!DOCTYPE html><!--To change this license header, choose License Headers in Project Propert ...
- 解决织梦channel标签 指定typeid或设置son时 currentstyle无效的修复办法
{dede:channel type='son' row='8' currentstyle="<li><ahref='~typelink~' class='thisclas ...
- DOCTYPE的详细图解
之前有一次写代码的时候忘记写了<!DOCTYPE html> 导致样式的效果一直有点问题,查了很久才发现时候这个的锅.之后自己详细的来查找了DOCTYPE的作用. 在目前,基本上都是采用浏 ...
- Spring知识点总结大全(1)
1.Spring的分层结构 1.Presentation layer(表示层) (1) 表示逻辑(生成界面代码) (2) 接收请求 (3) 处理业务层抛出的异常 (4) 负责规则验证(数据格式,数据非 ...
- hashcode深入理解
带着问题去理解: 1. Object类HashCode方法是如何实现的,和String类有什么区别? 2.HashCode和Equals之间的关系? 一.hashCode作用 hashCode方法返回 ...
- shell学习--grep1
一. grep的来源 通过ex编辑器来查找某个字串: :/pattern/p 其中p是打印,包含字符串pattern的第一行将被打印:如果需要打印包含pattern的所有行,可以这样: :/g/pat ...
- 【Mail】邮件的基础知识和原理
电子邮件概念 电子邮件是-种用电子手段提供信息交换的通信方式,是互联网应用最广的服务.通过网络的电子邮件系统,用户可以以非常低廉的价格(不管发送到哪里,都只需负担网费).非常快速的方式(几秒钟之内可以 ...
- 【Java学习笔记】静态导入
package p2; //import static java.util.Collections.max; import java.util.ArrayList; import static jav ...