1 (edited by AD1408 2016-12-17 21:08:41)

Topic: Replacing tGrid doubleclick

procedure Form1_tgSearchSaleInv_OnCellDoubleClick (Sender: string; ACol, ARow: Integer);
begin
     //Script for replacing double click action on a tGrid record with show records button action please....

end;

If the above is not doable then disabling tGrid CellDoubleClick or DoubleClick (whichever is the correct one) could do the job.


I like to use this solution on sample project "CR and DB - Refunds 3.zip" post-8, posted here:
http://myvisualdatabase.com/forum/viewtopic.php?id=2945

Adam
God... please help me become the person my dog thinks I am.

Re: Replacing tGrid doubleclick

Hi Adam,
This is the only thing that I could think of doing but there may be other ways that are closer to what you are trying to achieve.
Derek

Post's attachments

Attachment icon ad1408 doubleclick.zip 336.34 kb, 427 downloads since 2016-12-18 

Re: Replacing tGrid doubleclick

Derek,


Thank you so much.....  Extra tonnes of thanks for the quick reply........


That does the job of disabling double click fine.


Now let see if Dmitry offers double click acting as edit record (showRecord) only.

Adam
God... please help me become the person my dog thinks I am.

Re: Replacing tGrid doubleclick

Hello AD1408

In your last wish, you could try something as :

procedure Form1_OnShow (Sender: string; Action: string);
begin
    if Action = 'ShowRecord' then
    begin
        Form1.TableGrid1.dbPopupMenu.Items[0].Enabled := True;
    end;
end;

JB

Re: Replacing tGrid doubleclick

Hi JB,


Thanks for the suggestion...


Unless, I did something wrong it still launches both forms on double click.

Adam
God... please help me become the person my dog thinks I am.

Re: Replacing tGrid doubleclick

AD1408 wrote:

Hi JB,


Thanks for the suggestion...


Unless, I did something wrong it still launches both forms on double click.

procedure Form1_OnShow (Sender: string; Action: string);
begin
    Form1.tgSearchSaleInv.dbPopupMenu.Items[0].Enabled := False;
end;

procedure Form1_tgSearchSaleInv_OnCellDoubleClick (Sender: string; ACol, ARow: Integer);
begin
     Form1.Button8.Click; // here you can click on necessary button to edit record 
end;
Dmitry.

Re: Replacing tGrid doubleclick

Hello AD1048

In my answer to your previous question, I made a mistake

I would have write this good script :

procedure Form1_OnShow (Sender: string; Action: string);
begin
    if Action = 'ShowRecord' then
    begin
        Form1.TableGrid1.dbPopupMenu.Items[0].Enabled := False;
    end;
end;

Fortunately, Dmitry corrected the shot.

JB

Re: Replacing tGrid doubleclick

Hi Guys,


Thanks a lot.......


Again unless I'm doing something wrong replacing tGrid record double click to show record still didn't work.

Adam
God... please help me become the person my dog thinks I am.

Re: Replacing tGrid doubleclick

AD1408 wrote:

Hi Guys,


Thanks a lot.......


Again unless I'm doing something wrong replacing tGrid record double click to show record still didn't work.

Check it out.

Post's attachments

Attachment icon CR and DB - Refunds 3_fixed.zip 18.44 kb, 434 downloads since 2016-12-20 

Dmitry.

Re: Replacing tGrid doubleclick

Thank you very much Dmitry...........


I didn't realize that I had to use both procedure. It works just as I wanted. Thanks again.

Adam
God... please help me become the person my dog thinks I am.