I clicked the column 'View Cert' then it will display a PDF file on the viewer but the Blue row highlight the record changes and appear on that record AFTER I viewed pdf and close PDF. some strange on the behaviour..
Example, current row is row 3, I clicked Row 4 column 'View Cert', then it shown PDF content on screen and I closed the PDF viewer, the blue hightlight row 4 now... It should be hightlight row 4 FIRST and the display the row 4's PDF ...
procedure Tfrm_Certificate_Information.DBAdvGrid_CertificateClickCell(Sender: TObject;
ARow, ACol: Integer);
var cert_source_Location: TOpenDialog;
v_copy_cert_success: Boolean;
Lfrm_PDFViewer : Tfrm_PDFViewer;
begin
If ACol = 2 then //Upload Certificate file in PDF format into central storage
begin
//Make sure not in browse mode, the column can allow user to click and upload
if ds_mode_Staff_Info_Details_Cert <> 'BROWSE' then
begin
cert_source_Location := TOpenDialog.create(self);
cert_source_Location.Title := 'Select the source location of certificate file';
cert_source_Location.Filter := 'pdf files (*.pdf)|*.pdf'; //only show pdf file
if cert_source_Location.Execute then
begin
// call copy_CertFiles_to_Server( source_path, target_path );
v_copy_cert_success := copy_CertFiles_to_Server( cert_source_Location.FileName, g_cert_target_location + '\' + ExtractFileName(cert_source_Location.FileName) );
if v_copy_cert_success then
begin
AdvSmoothMessageDialog1.Caption := '[Notification]';
AdvSmoothMessageDialog1.HTMLText.Text := 'The certificate file has been copied to our central database system.';
AdvSmoothMessageDialog1.Buttons.Clear;
AdvSmoothMessageDialog1.Buttons.add;
AdvSmoothMessageDialog1.Buttons[0].Caption := 'OK';
AdvSmoothMessageDialog1.Buttons[0].ButtonResult := mrOK;
if AdvSmoothMessageDialog1.ExecuteDialog = mrOK then
begin
end; //end if
end;
.
..
.....
.......