TDBAdvGrid row selection

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;

.
..
.....
.......

This is because your code is blocking, i.e. the PDF showing does not permit the TDBAdvGrid code to continue (and thus update the row). This behavior is by design, to allow to write code in OnClickCell that blocks certain cell selections.
You might add code to update the DBAdvGrid.Row from OnClickCell if you want this row hight to happen immediately or you might show the PDF from the OnMouseUp event.