GridView 显示行号 设置行号列的宽度
/// <summary>
/// GridView 显示行号 设置行号列的宽度
/// </summary>
/// <param name="gv">GridView 控件名称</param>
/// <param name="width">行号列的宽度 如果为null或为0 默认为30</param>
public void DrawRowIndicator(DevExpress.XtraGrid.Views.Grid.GridView gv, int width) {
gv.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gv_CustomDrawRowIndicator);
if (width != null)
{
if (width != 0)
{
gv.IndicatorWidth = width;
}
else {
gv.IndicatorWidth = 30;
}
}
else {
gv.IndicatorWidth = 30;
}
}
//行号设置
private void gv_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) {
if (e.Info.IsRowIndicator && e.RowHandle > -1) {
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
调用:
DrawRowIndicator(gridView1, 30);
备注:
显示行号可以直接给GridView添加CustomRowIndicator事件 ,即上面的“行号设置”方法。
GridView 显示行号 设置行号列的宽度的更多相关文章
- CSS: Table-Layout & Word-Break 设置表和列的宽度固定不变
1. 设置Table的列宽由表格宽度和列宽度设定(指定表格宽度,各个列宽度): table#tbl_id{table-layout:fixed;} 2. 设置TD内容根据宽度进行换行,即使字符串之间无 ...
- 使用GridVIew显示Gantt(甘特图),动态增减列
说明:本例是做了工厂的排机报表 一.根据查询日期初始化GridView列 private void IniGridView(DateTime p_DateS,DateTime p_DateE) { / ...
- DevExpress GridControl 显示行号、设置行号宽
显示行号类 /// <summary> /// GridView 显示行号 设置行号列的宽度 /// </summary> /// <param name="g ...
- Linux显示行号设置
linux显示行号设置 第一步,打开vim vi ~/.vimrc 第二步,在该文件中加入一行,命令如下: set nu # 显示行号 set nonu # 不显示行号 微信公众号:喵哥解说 公众号介 ...
- C# XtraGrid的行指示器(RowIndicator)行号以及图标设置
以下是几种对Xtragrid的行指示器的几种操作方法,在实际场景当中,很多都需要用到,直接上效果图和源码 一.基本篇—设置表头行号 1.效果图 2.实现方法 需要对XtraGrid事件CustomDr ...
- vi设置行号
首先,我们先打开一个文件,用vim 文件名 就可以直接使用vim打开 我们事先写了一些内容在这个txt里面,我们可以看到如下内容 在这里,我们可以直接敲命令, :set number 或者 ...
- gedit 没有preference项,使preference回归,并用命令行设置行号,text wrapping等
1.最简单的,使preference选项回来: gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} ...
- Pycharm使用问题# 行号设置
设置行号就很简单了,在Settings中找到Editor-Appearance,选中Show line numbers即可.
- gedit 没有preference项,使preference回归,并用命令行设置行号,解决centos7下中文乱码,text wrapping等问题
1. 最简单的,使preference选项回来: gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} ...
随机推荐
- MongoDB系列四:解决secondary的读操作
http://blog.itpub.net/26812308/viewspace-2124660/ 在Replica sets 中的secondary节点默认是不可读的.使用Replica Sets实 ...
- asp.net敏感词过滤
敏感词过滤是一个能够让用户发表评论的网站的一个很重要的功能(你懂的~) 下面开始全套流程: 1.需要有一套比较完整的词库,由于我的词库很少所以就不贴上来了,网上找找应该很多 2.设计一个可以将词库导入 ...
- [转]解决Docker容器时间与主机不一致问题
原文: https://blog.csdn.net/luckystar689/article/details/76572046 https://stackoverflow.com/questions/ ...
- Nginx常用Rewrite(伪静态规则)WordPress/PHPCMS/ECSHOP/ShopEX/SaBlog/Discuz/DiscuzX/PHPWind/Typecho/DEDECMS
目前已收集Wordpress.Wordpress二级目录.PHPCMS.ECSHOP.ShopEX.SaBlog.Discuz.Discuz X.PHPWind.Typecho.DEDECMS: Wo ...
- C#控件之DataGridView
第一种:DataSet ds=new DataSet (); this.dataGridView1.DataSource=ds.Table[0]; 第二种:DataTable dt=new DataT ...
- [PWA] Access the Camera in a PWA built with React
It's possible to access some, but not all, of the native device features from a PWA. One that we can ...
- Linux Ubuntu下Dropbox图标消失
Linux下的Dropbox是支持命令行模式的.,在terminal中输入dropbox后,如下提示: Dropbox command-line interface commands: Note: u ...
- Android学习(七) Android实现计算器
前台页面代码,通过线性布局方式实现计算器页面:如图所示 color.xml,自定义颜色values: <?xml version="1.0" encoding="u ...
- 64位windows2003 未在本地计算机上注册 microsoft.jet.oledb.4.0 提供程序
64位windows2003系统 使用 mdb数据库时候出现如下错误. 可能用office的一些比较旧的程序时候会这样. 未在本地计算机上注册 microsoft.jet.oledb.4.0 提供程序 ...
- ios 使用gcd 显示倒计时
__block ;//倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ...