1 (edited by AD1408 2021-03-15 10:34:52)

Topic: how to copy treeview item (node name) into edit box?

I wanted to copy treeview node name into a edit box. When there are too many nodes finding the tablegrid that contains the becomes time consuming task.



I have tried the following but didn't work:

frmProjects.edFolder.Text := form1.ProjectTreeView3.sqlvalue;

Any help please?

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

Re: how to copy treeview item (node name) into edit box?

procedure Form1_TreeView1_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
  Form1.Edit1.Text:= SQLExecute('SELECT name FROM test WHERE id='+Form1.TreeView1.sqlValue);
 end;
Post's attachments

Attachment icon test.rar 3.38 kb, 179 downloads since 2021-03-15 

Re: how to copy treeview item (node name) into edit box?

Hi sibprogsistem,


Thank you very much for your kind help.
I think, I couldn't explain my issue properly. My apologies.

I wanted copy tree node on secondary form and save.


Please see the following test file, I couldn't get it working on form1 and secondary form (frmEmployee) somehow?

Post's attachments

Attachment icon TreeViewTest2.zip 7.72 kb, 184 downloads since 2021-03-16 

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

Re: how to copy treeview item (node name) into edit box?

Сложно перевести

difficult to translate

procedure Form1_TreeView1_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
Form1.edFolderForm1.Text:= SQLExecute('SELECT Name FROM OrgStructure WHERE id='+Form1.TreeView1.sqlValue);
end;

procedure frmEmployee_OnShow (Sender: TObject; Action: string);
begin
frmEmployee.TreeView1.dbitemid := form1.TreeView1.dbItemID;
frmEmployee.edFolder.Text:= SQLExecute('SELECT Name FROM OrgStructure WHERE id='+frmEmployee.TreeView1.sqlValue);
end;
Post's attachments

Attachment icon TreeViewTest2.rar 6.61 kb, 213 downloads since 2021-03-16 

Re: how to copy treeview item (node name) into edit box?

Thank you very much sibprogsistem.....................
Truly appreciated.................................

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