cxgrid动态显示行号
uses cxLookAndFeelPainters;
type
TMyCxGrid = class(TObject)
    class procedure DrawIndicatorCell(
      Sender: TcxGridTableView; ACanvas: TcxCanvas;
      AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
  end;
{ TMyCxGrid }
class procedure TMyCxGrid.DrawIndicatorCell(Sender: TcxGridTableView;
  ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
  var ADone: Boolean);
var
  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, -1, -1);
Sender.LookAndFeelPainter.DrawHeader(ACanvas, AViewInfo.Bounds,
      ATextRect, [], cxBordersAll, cxbsNormal, taCenter, 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, -1, -1);
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, vaCenter,
    False, False, IntToStr(AIndicatorViewInfo.GridRecord.Index + 1),
    AFont, AFontTextColor, AColor);
  ADone := True;
//  ASender.LookAndFeelPainter.DrawIndicatorImage(ACanvas, ATextRect,
//    AIndicatorViewInfo.IndicatorKind);
end;
procedure ShowLineNo(c: TcxGridDBTableView);
begin
  c.OptionsView.Indicator := True;
  c.OptionsView.IndicatorWidth := 40;
  c.OnCustomDrawIndicatorCell := TMyCxGrid.DrawIndicatorCell;
end;

cxgrid动态显示行号的更多相关文章
- cxGrid 显示行号及行号列列名
		cxGrid默认不显示行号,但是可以通过cxGrid1DBTableView1CustomDrawIndicatorCell事件来重绘行号 选中cxGrid1DBTableView1,在OnCusto ... 
- cxGrid显示行号
		定义一个类: TMyCxGrid = class(TObject) class procedure DrawIndicatorCell( Sender: TcxGridTableView; ACanv ... 
- 让cxGrid像Excel那样高亮显示选区的行号列标
		http://www.oschina.net/code/snippet_54100_1102 Developer Express的cxGrid控件是一个相当有特色的数据栅格组件,支持自动分组.卡片式显 ... 
- linux vim 插入行号
		1 在文本中插入行号 最近有朋友提到某编辑器有一个可以插入行号的插件,问Vim有没有办法可以在文章中插入行号.%$^&*#8~#$@#!--让我们看一下有多少种方式可以在vim中插入行号或数字 ... 
- vim 加行号 和取消行号
		:set nu #是加行号 :set nonu #是去掉行号 
- databtables 设置(显示)行号
		var table = $('#priceStrategtyTable').DataTable({ "rowCallback": function( row, da ... 
- EasyUI datagrid : 启用行号、固定列及多级表头后,头部行号位置单元格错位的问题
		症状如图: 上图中,行号列与checkbox 列融合了.解决方法是在datagrid 的 onLoadSuccess 事件中加入如下代码: var opts = $(this).datagrid('o ... 
- Android studio 显示代码行号 设置
		首先我们打开我们的Android Studio. 这时会弹出setting页面,我们选择show line numbers然后点击确定按钮. 此时我们就可以看到代码左侧显示出行号了 我们可 ... 
- gedit 没有preference项,使preference回归,并用命令行设置行号,text wrapping等
		1.最简单的,使preference选项回来: gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} ... 
随机推荐
- 安装RabbitMq-----windows
			在官网download我们所需要的版本,安装rabbitMq需要erlang支持 rabbitMq :http://www.rabbitmq.com/download.html erlang :ht ... 
- Js语言的奇怪特性
			var a = .3 - 2; console.log(a); a = 0.099999998 而不是0.1,是不是很奇怪? 
- runloop 和 CFRunLoop -  定时器 - NSTimer 和 GCD定时器
			1. 2. #import "ViewController.h" @interface ViewController () @property (nonatomic, strong ... 
- catkin_make 与cmake
			http://blog.csdn.net/zyh821351004/article/details/50388429 1. catkin_make 与cmake的关系 程序在cmake编译的流程: ... 
- springMVC将处理的后的数据通过post方法传给页面时,可能会出现乱码问题,下面提出解决post乱码问题的方法
			在web.xml中加入: <!-- 解决post乱码问题 --> <filter> <filter-name>CharacterEncodingFilter< ... 
- phpstorm2018.3的安装和激活和汉化
			安装 第一步:解压并打开文件,运行安装程序,点击Next进入下一步, 第二步:选择软件安装目录,自定义选择安装根目录--> 注意!后面还需要找安装目录里的文件,所以记住安装到一个比较容易查看的目 ... 
- Halcon小函数的封装和代码导出
			一.Halcon小函数的封装和修改 1.名词解释: 算子:指Halcon中最基础.最底层的函数(即你看不到它的代码实现),一个算子只有一句话,例如threshold算子. 小函数:由多个算子组合成的函 ... 
- metasploit 利用MS08-067渗透攻击xp系统全过程
			工具:metasploit,目标系统 windows xp sp3 English 渗透攻击过程 1.search MS08-067 2. use exploit/windows/smb/ms08_ ... 
- Underscore模版引擎的使用-template方法
			之前项目里有遇到在DOM中增加大量的html结构的时候,傻乎乎的在js中写一堆模版,然后用replace一个一个做替换.当时就是难看了点,不觉得啥,现在了解了模版引擎之后回头来看真的比较捉急了,以后是 ... 
- restful发布服务
			概述 REST 从资源的角度来观察整个网络,分布在各处的资源由URI确定,而客户端的应用通过URI来获取资源的表示方式.获得这些表徵致使这些应用程序转变了其状态.随着不断获取资源的表示方式,客户端应用 ... 
