procedure Tkhcp_select_win.cxdbview2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
var str: string;
i, j: integer;
mys: Tmemorystream;
cpbz: tcpbz_win;
begin
if (cxdbview2.Columns[ACellViewInfo.Item.Index].Caption = '中文说明') then
begin
if ACellViewInfo.GridRecord.Values[ACellViewInfo.Item.Index]<>null then
str:=ACellViewInfo.GridRecord.Values[ACellViewInfo.Item.Index];
//showmessage(str);
if str<>'' then
begin
cpbz := tcpbz_win.Create(nil);
cpbz.Top := cxgrid2.top;
cpbz.memo1.ReadOnly := true;
cpbz.memo1.Text := '';
if str <> '' then cpbz.memo1.Text := str;
cpbz.ShowModal;
cpbz.Free;
end;
//showmessage(str);
end
else
begin
if (MemTableEh2.eof) or (MemTableEh2.bof) then exit;
if ACellViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('check').Index]<>true then
begin
showmessage('请选择');
exit;
end;
MemTableEh1.Append;
for i := 0 to MemTableEh1.Fields.count - 1 do
begin
if MemTableEh1.Fields[i].fieldname <> 'yytp' then
MemTableEh1.Fields[i].asstring := MemTableEh2.fieldbyname(MemTableEh1.Fields[i].FieldName).asstring
else
begin
mys := Tmemorystream.Create;
TBlobField(MemTableEh2.fieldbyname(MemTableEh1.Fields[i].fieldname)).SaveToStream(mys);
mys.Position := 0;
TBlobField(MemTableEh1.fields[i]).LoadFromStream(mys);
mys.Free;
end;
end;
MemTableEh1.post;
MemTableEh2.Delete;
end;
end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。