procedure TNewPurPlanFrm.SGpoSelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
var
SgCanEdit: TGridOptions;
begin
SGCanEdit:=SGPo.Options;
if ACol in [0..3,6] then
{0,1,2,3,6列不能修改}
Exclude(SGCanEdit,goediting)
else
Include(SGCanEdit,goediting);
SGPo.Options:=SGCanEdit;
end;
ARow: Integer; var CanSelect: Boolean);
var
SgCanEdit: TGridOptions;
begin
SGCanEdit:=SGPo.Options;
if ACol in [0..3,6] then
{0,1,2,3,6列不能修改}
Exclude(SGCanEdit,goediting)
else
Include(SGCanEdit,goediting);
SGPo.Options:=SGCanEdit;
end;
if acol=1 then
Exit;
这样就会使只读状态。上句代码表示,如果让第一列设为只读状态。
//i就是你想要设成只读的几列
===================================================================
暗恋女司机,薪水全做公交车了!
http://www.csdn.net/expert/topic/926/926315.xml?temp=4.807681E-02
ARow: Integer; var CanSelect: Boolean);
var
begin
if ACol in [0..3,6] then
canselect:=false;
end;