delphi DBGridEh 删除指定列

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了delphi DBGridEh 删除指定列相关的知识,希望对你有一定的参考价值。

delohi6中

if (FDeptID='001' ) or (FDeptID='002' ) then
begin
DBGridEh1.Columns.Items[8].Visible:=true;
DBGridEh1.Columns.Items[15].Visible:=true;
end
根据条件指定此列是否可见 ,我现在不想限制是否可见,而是根据条件删除此列。

参考技术A if DBGrid1.SelectedRows.CurrentRowSelected = True then //判断当前行是否被选中
begin
if MessageBox(Handle,'确定要删除记录吗?', '提示', mb_IconInformation+mb_YesNo+mb_DefButton2) = mrYes then
DBGrid1.SelectedRows.Delete
end
else
Application.MessageBox(PChar('没有任何记录或者没有被选中!'), '提示', mb_IconInformation);追问

这是删除行记录,不是删除列记录

本回答被提问者和网友采纳

以上是关于delphi DBGridEh 删除指定列的主要内容,如果未能解决你的问题,请参考以下文章