起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 448|回复: 0

如何在DataGrid中嵌入控件

[复制链接]
发表于 2012-3-29 17:30:28 | 显示全部楼层 |阅读模式
在DataGridCustomDrawCell事件中加入如下代码:
//InputPanel就是要嵌入的控件

  if  ASelected or  AFocused then
   begin
       if (DataGrid.FocusedNode = ANode) and    (DataGrid.FocusedField.FieldName='ZCF') and
          (AColumn.Caption ='职称加分') and
          (DataGrid.Columns[DataGrid.FocusedColumn].FieldName='ZCF' ) then
       begin
           InputPanel.Top:= ARect.Top;
           InputPanel.Height:= DataGrid.DefaultRowHeight;
           InputPanel.Left:= ARect.Left;
           InputPanel.Width:= ARect.Right - ARect.Left;
           InputPanel.Visible:= true;
       end;
   end;

:china:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2024-5-5 02:24 , Processed in 0.041867 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表