javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Editor$Edit$lkbPost", "", true, "", "", false, true))
Code
procedure GetAttnList(Const ACorpID:Integer);
var aSQLQuery:TSQLQuery;
begin
if ACorpID<=0 then Exit;
aSQLQuery:=TSQLQuery.Create(nil);
with aSQLQuery do try
Close; SQL.Clear;
SQLConnection:=SQLConn;
SQL.Add('select CName, Tel from Corps_Attns');
SQL.Add('where SysID=:SysID and CorpID=:CorpID');
ParamByName('SysID').AsInteger:=FSysID;
ParamByName('CorpID').AsInteger:=ACorpID;
Open;
GridBillItems.Columns.Items[4].PickList.BeginUpDate;
GridBillItems.Columns.Items[4].PickList.Clear;
while not Eof do begin
//GridBillItems.Columns.Items[4].PickList.Add(FieldByName('CName').AsString+'('+FieldByName('Tel').AsString+')');
GridBillItems.Columns.Items[4].PickList.Add(FieldByName('CName').AsString);
Next;
end;
finally
GridBillItems.Columns.Items[4].PickList.EndUpDate;
Free;
end;
end;
========================================
procedure GridBillItemsCellClick(Column: TColumnEh);
begin
if SameText(Uppercase(Column.FieldName), 'ATTN') then
GetAttnList(cdsPostMngBILLSItems.FieldByName('CorpID').AsInteger);
end;
========================================
begin
GridBillItems.OnCellClick:=@GridBillItemsCellClick;
procedure GetAttnList(Const ACorpID:Integer);
var aSQLQuery:TSQLQuery;
begin
if ACorpID<=0 then Exit;
aSQLQuery:=TSQLQuery.Create(nil);
with aSQLQuery do try
Close; SQL.Clear;
SQLConnection:=SQLConn;
SQL.Add('select CName, Tel from Corps_Attns');
SQL.Add('where SysID=:SysID and CorpID=:CorpID');
ParamByName('SysID').AsInteger:=FSysID;
ParamByName('CorpID').AsInteger:=ACorpID;
Open;
GridBillItems.Columns.Items[4].PickList.BeginUpDate;
GridBillItems.Columns.Items[4].PickList.Clear;
while not Eof do begin
//GridBillItems.Columns.Items[4].PickList.Add(FieldByName('CName').AsString+'('+FieldByName('Tel').AsString+')');
GridBillItems.Columns.Items[4].PickList.Add(FieldByName('CName').AsString);
Next;
end;
finally
GridBillItems.Columns.Items[4].PickList.EndUpDate;
Free;
end;
end;
========================================
procedure GridBillItemsCellClick(Column: TColumnEh);
begin
if SameText(Uppercase(Column.FieldName), 'ATTN') then
GetAttnList(cdsPostMngBILLSItems.FieldByName('CorpID').AsInteger);
end;
========================================
begin
GridBillItems.OnCellClick:=