常用到的
筆記資料
觸發編輯控管方法
procedure TGA037.DBGrid2ColEnter(Sender: TObject);
begin
if (ClientDataSet1.State in [dsInsert, dsedit]) then
//DBGrid2CellClick(Column: TColumn)
// if (pos(Column.FieldName, 'ABNORMAL_LOSS,ABNORMAL_TYPE,ABNORMAL_RATIO,NOTES') > 0) then dbgrid2.Options := dbgrid2.Options //+ [dgEditing];
if (pos(TDBGrid(Sender).SelectedField.FieldName, 'ABNORMAL_LOSS,ABNORMAL_TYPE,ABNORMAL_RATIO,NOTES') > 0) then dbgrid2.Options := dbgrid2.Options + [dgEditing]
else dbgrid2.Options := dbgrid2.Options - [dgEditing];
{ if (dbgrid2.SelectedIndex in [4,5,6,7,9,11,12,13,14,15]) or ((dbgrid2.SelectedIndex = 8) and (V_accept = true)) then dbgrid2.Options:=dbgrid2.Options+[dgEditing]
else dbgrid2.Options:=dbgrid2.Options-[dgEditing];}
end;
end;
大家一起加入blogads 賺零用錢!!