Topic: Editable TG

Happy New Year to all..........


I have this simple testing utility using treeview and editable tablegrid but couldn't get it working.
- cannot save and display tg records under selected treview node.


Here is the sample app:

Post's attachments

Attachment icon Tester1.zip 6.1 kb, 104 downloads since 2023-01-09 

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

2 (edited by sparrow 2023-01-09 12:46:40)

Re: Editable TG

Hi


Delete 'bSearch' on increment search properties in the TableGrid1.
This makes it difficult to work out a double click to edit the cell.


In addition, you do not have a binding in the 'id_ItemsTree' field in the 'items' table.
If the tree entry contains no entry ( dbItemId = -1) then editing the entry in tg creates
an entry without a tree id. If the tree entry contains a value, then it can be edited.

3 (edited by AD1408 2023-01-09 13:39:13)

Re: Editable TG

Hi sparrow,
Thanks a lot for the reply...
However, I still couldn't get it work.
Would you be so kind to upload the working version of the "Tester1' please..........

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

4 (edited by sparrow 2023-01-09 14:48:36)

Re: Editable TG

I did not write that I have a ready-made solution.
I just described why.
I'll try.
Of the options, do everything manually (reading, writing) or editing in a table and the first entry through a separate form.
This is what comes to mind immediately.
Really it is so critical, editing in the table?

Re: Editable TG

Thanks sparrow....
Having read, write, edit and delete functions on same form are much more useful for intended use.
Hopefully, there'll be solution...

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

Re: Editable TG

You can try like this.
There is a side effect, the last column in TG.
Unfortunately the column must be visible. But it may not be active.
Maybe someone can suggest a better solution.

Post's attachments

Attachment icon Tester1 m.zip 7.46 kb, 131 downloads since 2023-01-10 

Re: Editable TG

sparrow wrote:

You can try like this.
There is a side effect, the last column in TG.
Unfortunately the column must be visible. But it may not be active.
Maybe someone can suggest a better solution.


Hi sparrow,
Thank you very much for your kind help...
Truly appreciated..........


I have added following lines to avoid out of index error when clicked on empty tg without selected treeview item with record:

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
Form1.TreeView1.SelectedRow:= 0;
Form1.bSearch.Click;
Form1.TreeView1.SetFocus;
end;
Adam
God... please help me become the person my dog thinks I am.