cxGrid显示行号
定义一个类:
TMyCxGrid = class(TObject)
class procedure DrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
end; class procedure TMyCxGrid.DrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
var
FValue: string;
FBounds: TRect;
//method
AIndicatorViewInfo: TcxGridIndicatorRowItemViewInfo;
ATextRect: TRect;
AFont: TFont;
AFontTextColor, AColor: TColor;
begin
AFont := ACanvas.Font;
AColor := clBtnFace;
AFontTextColor := clWindowText;
if (AViewInfo is TcxGridIndicatorHeaderItemViewInfo) then
begin
ATextRect := AViewInfo.Bounds;
InflateRect(ATextRect, -, -); Sender.LookAndFeelPainter.DrawHeader(ACanvas, AViewInfo.Bounds,
ATextRect, [], cxBordersAll, cxbsNormal, taCenter, TcxAlignmentVert.vaCenter,
False, False, 'NO',AFont, AFontTextColor, AColor);
ADone := True;
end;
if not (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
Exit;
ATextRect := AViewInfo.ContentBounds;
AIndicatorViewInfo := AViewInfo as TcxGridIndicatorRowItemViewInfo;
InflateRect(ATextRect, -, -); if AIndicatorViewInfo.GridRecord.Selected then
AFont.Style := ACanvas.Font.Style + [fsBold]
else
AFont.Style := ACanvas.Font.Style - [fsBold]; Sender.LookAndFeelPainter.DrawHeader(ACanvas, AViewInfo.ContentBounds,
ATextRect, [], [bBottom, bLeft, bRight], cxbsNormal, taCenter, TcxAlignmentVert.vaCenter,
False, False, IntToStr(AIndicatorViewInfo.GridRecord.Index + ),
AFont, AFontTextColor, AColor);
ADone := True; end;
然后调用即可:
tvList.OptionsView.Indicator:=True;
tvList.OptionsView.IndicatorWidth:=;
tvList.OnCustomDrawIndicatorCell:= TMyCxGrid.DrawIndicatorCell;
测试GridMode显示有问题。
cxGrid显示行号的更多相关文章
- cxGrid 显示行号及行号列列名
cxGrid默认不显示行号,但是可以通过cxGrid1DBTableView1CustomDrawIndicatorCell事件来重绘行号 选中cxGrid1DBTableView1,在OnCusto ...
- vc6.0如何显示行号以及出现版本不兼容问题
有时编译时,提示某某行有错,但是要定位到某一行的话,如果在编辑页面能够将行号显示出来,查找也就更方便了,下面我来介绍一下让VC6.0显示行号的方法. 工具/原料 VC6.0.显示行号的插件 方 ...
- Row_Number()显示行号
SELECT *, Row_Number() OVER (partition by deptid ORDER BY salary desc) rank FROM employee Row_Number ...
- vim显示行号、语法高亮、自动缩进的设置
转载自:http://blog.csdn.net/chuanj1985/article/details/6873830 在UBUNTU中vim的配置文件存放在/etc/vim目录中,配置文件名为v ...
- mac/linux中vim永久显示行号、开启语法高亮
步骤1: cp /usr/share/vim/vimrc ~/.vimrc 先复制一份vim配置模板到个人目录下 注:redhat 改成 cp /etc/vimrc ~/.vimrc 步骤2: vi ...
- 如何让vim编辑器永久显示行号
在Linux环境下的编辑器有vi.vim.gedit等等.进入这些编辑器之后,为了方便我们需要编辑器显示出当前的行号,可偏偏编辑器默认是不会显示行号的.我们有二种办法可以解决: 第一种是,手动显示:在 ...
- PyCharm 教程(四)显示行号
PyCharm 教程(四)显示行号 在PyCharm 里,显示行号有两种办法: 1,临时设置.右键单击行号处,选择 Show Line Numbers. 但是这种方法,只对一个文件有效,并且,重启Py ...
- DEV控件Grid显示行号
DEV控件Grid的显示行号需要通过一个事件来设置,具体设置代码为: private void gridView1_CustomDrawRowIndicator(object sender, DevE ...
- vs2013显示行号
随便打开一个项目,可以看到代码框内并没有显示行号 选择“工具”-“选项”,打开后界面如下 选择文本编辑器,找到下图中的“行号”并勾选 行号可以显示了 5 这样我们就完成了任务
随机推荐
- 《马上有招儿:PPT商务演示精选20讲(全彩) 》
<马上有招儿:PPT商务演示精选20讲(全彩) > 基本信息 作者:马建强 霍然 出版社:电子工业出版社 ISBN:9787121225123 上架时间:2014-3-11 出版日期 ...
- mac下zsh的使用:主题、z命令
安装Oh-My-ZSH: `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh` zs ...
- 【BZOJ】【3053】The Closest M Points
KD-Tree 题目大意:K维空间内,与给定点欧几里得距离最近的 m 个点. KD树啊……还能怎样啊……然而扩展到k维其实并没多么复杂?除了我已经脑补不出建树过程……不过代码好像变化不大>_&g ...
- [leetcode]Populating Next Right Pointers in Each Node @ Python
原题地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/ 题意: 1 / \ 2 3 / \ ...
- MSSQL工作中常用的小技巧
大概看了一下有接近二十天自己没有写博客了,一来是因为国庆之前公司工作总会比较繁杂一点,国庆自己也需要休息,二来是因为学习一些新的东西,公司写了一天SQL回家看了看以前的笔记,感觉还挺不错,贴出来供大家 ...
- IE9对HTML5中一部分属性不提供支持的原因
为什么在IE9中对于HTML5标准中的离线应用程序以及CSS3中的一部分不提供支持?笔者间接了解到了这个原因. 微软日前已经发布了Internet Explorer 9(以下简称IE9)正式版.在该版 ...
- SqlServer2008第一次安装后连接问题
在第一次安装好SqlServer并启动服务后,对服务器进行连接: 1:根据计算机名进行windows身份验证 结果如下 2:根据计算机名进行SqlServer身份验证 结果如下: 3:根据IP进行wi ...
- [Node.js]24. Level 5: Express, Express routes
Create an express route that responds to GET requests at the URL /tweets that responds with the file ...
- STL - 容器 - Set
Set根据特定排序准则,自动将元素排序. Set不允许元素重复. 一些常规操作: SetTest.cpp #include <iostream> #include <set> ...
- IIS 之 连接数、并发连接数、最大并发工作线程数、队列长度、最大工作进程数
一.IIS连接数 一般购买过虚拟主机的朋友都熟悉购买时,会限制IIS连接数,顾名思义即为IIS服务器可以同时容纳客户请求的最高连接数,准确的说应该叫“IIS限制连接数”. 客户请求的连接内容包括: [ ...