......
private
{ Private declarations }
procedure cxGrid1DBTableView1ColumnPropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.cxGrid1DBTableView1ColumnPropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
//.......
end;
procedure TForm1.cxButton1Click(Sender: TObject);
begin
//设置第3列为按钮属性:
cxGrid1DBTableView1.Columns[3].PropertiesClass:=TcxButtonEditProperties;
//关联点击事件:
(cxGrid1DBTableView1.Columns[3].Properties as TcxButtonEditProperties).OnButtonClick
:=cxGrid1DBTableView1ColumnPropertiesButtonClick;
end;
......
cxGrid动态创建的列里动态创建事件的方法
最新推荐文章于 2025-11-03 09:43:21 发布
本文介绍如何在Delphi中使用cxGrid组件设置特定列为按钮列,并关联点击事件。通过设置Columns属性,可以指定某一列为按钮类型,并实现按钮点击响应。
364

被折叠的 条评论
为什么被折叠?



