[原] 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 ...
随机推荐
- C代码编译成可执行程序的过程
C代码通过编译器编译成可执行代码,经历了四个阶段,依次为:预处理.编译.汇编.链接. 接下来详细讲解各个阶段 一.预处理 1.任务:进行宏定义展开.头文件展开.条件编译,不检查语法. 2.命令:gcc ...
- 转载 --ios 模型-setValuesForKeysWithDictionary
应用场景:app请求后端数据,返回的数据是JSON形式,如: { "is_favor" = 0; "is_follow" = 0; "is_prais ...
- oracle启动脚本 .
.#!/bin/bash set -x su -oracle >>EON lsnrctl start sqlplus /nolog >>EOF conn / as sy ...
- 嗯,开通blog了!
应老师建议,开通博客,“把学习时遇到的疑惑和问题随时用blog记录下来”,“把前期的学习心得写上,有时间最好把自己的学习计划也写上”. 用博客记录自己Linux和其他技术的学习日记,记录下学习实践中遇 ...
- lamp php的ssl,ssh支持
Php支持ssl,ssh扩展: 准备:可以成功解析php 1.curl的安装 [root@localhost~]# cd /usr/local/src/ [root@localhost~]# wget ...
- strstr函数的用法
C语言函数 编辑 包含文件:string.h 函数名: strstr 函数原型: extern char *strstr(char *str1, const char *str2); 语法: ...
- Thinking in Java 学习笔记(一)
chapter_01 对象导论 1.1 Java语言基础Smalltalk的特性: 万物皆对象 可以将对象视为一种奇特的变量,它可以存储数据(成员变量),也可以在自身上执行操作(方法). 程序对象 ...
- tnsnames.ora配置注意(连接新的数据库)
文件地址D:\app\think\product\11.2.0\instantclient_11_2\network\admin\tnsnames.ora# tnsnames.ora Network ...
- SQL Server2005索引碎片分析和解决方法
SQL Server2005索引碎片分析和解决方法 本文作者(郑贤娴),请您在阅读本文时尊重作者版权. 摘要: SQL Server,为了反应数据的更新,需要维护表上的索引,因而这些索引会形成碎片.根 ...
- C/C++中extern关键字解析
1 基本解释:extern可以置于变量或者函数前,以标示变量或者函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义.此外extern也可用来进行链接指定. 也就是说extern ...