Topic: send some cells from tablegrid

I want to send some cells in tablegrid after double click to another form textbox. ths is possible?


form1.tablegrid1
cells1,cells2,cells3,cells4,cells5......

after select and double click send to another form

for

form2
textbox1, textbox2 , textbox4

Re: send some cells from tablegrid

.

Post's attachments

Attachment icon doubleclick.7z 3.01 kb, 456 downloads since 2019-07-02 

Re: send some cells from tablegrid

thanks work perfect

Re: send some cells from tablegrid

Hello, I am writing in this topic because my problem is related to this post.

I would like only the values of the first column of each record to be loaded into the text boxes.

How can I do it ... Thanks.

5 (edited by sibprogsistem 2020-10-09 11:49:15)

Re: send some cells from tablegrid

madbit71 wrote:

Hello, I am writing in this topic because my problem is related to this post.

I would like only the values of the first column of each record to be loaded into the text boxes.

How can I do it ... Thanks.

 

procedure Form1_TableGrid1_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
begin
  form1.Edit1.Text:=Form1.TableGrid1.Cells[Form1.TableGrid1.SelectedRow,0];
  form1.Edit2.Text:=Form1.TableGrid1.Cells[Form1.TableGrid1.SelectedRow,1];
end;

Re: send some cells from tablegrid

Perfect...tx.

Re: send some cells from tablegrid

Hi,

Can you show me the exact script you used please.

Many thanks

John

Re: send some cells from tablegrid

This is what i used and get an error.

procedure Jobfiles_TableGrid2_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
begin

jobfiles.edit3.text:=jobfiles.TableGrid2.cells[jobfiles.TableGrid2.SelectedRow,1] ;

end;

Re: send some cells from tablegrid

This is what i used and get an error.

procedure Jobfiles_TableGrid2_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
begin

jobfiles.edit3.text:=jobfiles.TableGrid2.cells[jobfiles.TableGrid2.SelectedRow,1] ;

end;

10 (edited by derek 2020-10-12 23:53:04)

Re: send some cells from tablegrid

Hi John,
Without seeing your project or knowing what the error message is, I can only hazard a guess and suggest you try it like this:
procedure Jobfiles_TableGrid2_OnCellDoubleClick (Sender: TObject; ACol, ARow: Integer);
begin
  jobfiles.edit3.text:=jobfiles.TableGrid2.cells[acol,arow] ;
end;
This will copy the value of whatever cell you've clicked on into the specified edit field.
If that doesn't fix it, then upload your project.
Also, have a look at the attached example that allows you to click on ANY cell to copy its value and then click on ANY edit field to paste the value;  maybe this can give you some pointers about the basic process.
Derek.

Post's attachments

Attachment icon copypastecell.zip 337.6 kb, 319 downloads since 2020-10-13