点列头排序

1.add  ehlibado.pas  to project.

2.grideh>ColumnDefValues>Title>TitleButton=true;

3.grideh>SortLocal=true;

4.grideh>optionsEh>dghAutoSortMarking=true;

install component

open ehlib.dpk,replace ,then install ok!

in '    replace to  in '..\Common\

grideh隔行变色:EvenRowColor/OddRowColor

grid的title:渐变色,TitleParams.FillStyle=cfstGradientEh

动态创建Grid列

  var
column : TColumnEh;
begin
self.DBGridEh1.Columns.AddAllColumns( true );
column := self.DBGridEh1.Columns.Add;
column.Title.Caption := '姓名';
column.Width := ;
column.FieldName := 'name';
     TColumnEh * column;
column = DBGridEh1->Columns->Add( );
column->FieldName = "name";
column->Title->Caption = "姓名";
column->Width = ;

这个父容器释放的时候会自动释放,所以不存在内存泄漏。

尾行合计

方法:双击grideh打开字段列表;选择需要求和的字段,有个属性Footer

https://blog.csdn.net/yanjinrong/article/details/43816369

GridEH编辑框当前单元格的值,正在编辑的值,正在输入的值,当前输入的值

self.DBGridEh1.InplaceEditor.Text

if Grid.InplaceEditorVisible then
    Result := Grid.InplaceEditor.Text

Result := Grid.InplaceEditor.top

让进入编辑模式

DBGridEh1.EditorMode:=True;

InplaceEditor本质上是MaskEdit

TInplaceEdit = class(TCustomMaskEdit)

procedure TCustomDBGridEh.ShowEditor;

procedure TCustomDBGridEh.UpdateEdit; //计算位置

function TCustomDBGridEh.CellEditRect(ACol, ARow: Longint): TRect;

DBGridEh.pas

function TCustomDBGridEh.CellEditRect(ACol, ARow: Longint): TRect;

// abscrect.top :=abscrect.top+ 20;
    Result.top:= abscrect.top;

grideh编辑框垂直居中

procedure TForm12.DBGridEh1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var
acol,arow:Integer;
arect:TRect;
begin
if self.DBGridEh1.TitleHeight< then Caption:=''; if (self.DBGridEh1.InplaceEditor<>nil) and(self.DBGridEh1.InplaceEditor.Visible) then //and (self.DBGridEh1.InplaceEditor.Top<=(25+ (self.FDMemTable1.RecNo-1)*(self.DBGridEh1.RowHeight+1) ) then
begin arect:= self.DBGridEh2.CellRectAbs(DataCol,DBGridEh1.Row,true);
self.Caption := Format('%d,%d,%d,%d',[DBGridEh1.Row, arect.Top,DBGridEh1.InplaceEditor.Top,DBGridEh1.InplaceEditor.Height]);
DBGridEh1.InplaceEditor.Alignment := taCenter;
if( DBGridEh1.InplaceEditor.Top <= + *(DBGridEh1.Row-) ) then
self.DBGridEh1.InplaceEditor.Top := self.DBGridEh1.InplaceEditor.Top+ ;
end; // self.Caption:='cc';
end;

最新文章

  1. bzoj1008快速面
  2. 如何激活win10 win10激活工具下载
  3. 模拟jquery的$()选择器的实现
  4. Upload java coed in Ubuntu(在Linux 16上,上传代码)
  5. Using Flash Builder with Flash Professional
  6. Repeated DNA Sequences
  7. UVA 10341 二分搜索
  8. Hibernate从入门到精通(六)一对一双向关联映射
  9. EntityFramework更新多条数据【8万】
  10. php数组操作函数
  11. Exchange Server 2010/2013功能差异
  12. ModelDriven
  13. 什么是Docker??
  14. Redis 高级部分
  15. Python3练习题 001:4个数字求不重复的3位数
  16. xtrabackup 在线主从搭建
  17. BIgnum类的程序提交
  18. VS每次F5都重新编译代码,即使没有任何修改
  19. 在 chrome 上导出 pdf
  20. Kotlin VS Java:基本语法差异(转载)

热门文章

  1. html中用变量作为django字典的键值
  2. hdu 3682 10 杭州 现场 C - To Be an Dream Architect 简单容斥 难度:1
  3. Java语言发展史和eclipse配置
  4. es6 中的generator函数控制流程
  5. tar格式 方法安装MySQL后,初次登录出现 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement
  6. ubuntu遇到的问题
  7. 51Nod 1081:子段求和(前缀和)
  8. 浅谈c#垃圾回收机制(GC)
  9. 【转载】python安装numpy和pandas
  10. streamsets microservice pipeline 试用