Topic: On Same form Add/Edit/Delete

Hi Guys,
I'm trying to do Add/Edit/Delete operations on same form (form1) using treeview and tg.
Issue I couldn't solve all records getting saved in treeview root instead of  in selected node.
Please see the sample project attached below:

Post's attachments

Attachment icon oSFAED_01.zip 8.1 kb, 34 downloads since 2025-03-22 

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

Re: On Same form Add/Edit/Delete

Hi Adam,


What logic are you trying to implement with treeview, table and edit field? How should they interact? Please describe.

Re: On Same form Add/Edit/Delete

sparrow wrote:

Hi Adam,


What logic are you trying to implement with treeview, table and edit field? How should they interact? Please describe.


Hi Sparrow,


I'm trying to do same thing if we were adding records via second form. Only difference is I like to achieve same thing on same form.
For example, If I select tree node '1111' on form1 tree and add a record, I like it to get listed in tree node '1111' on form1 not in root  (None) of the tree.
Basically, a record added to a selected node on same form, is not showing within that selected node.


There are more fields on actual project. On sample project, I only used one field and not done enabling / disabling buttons and fields which I'll do later.

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

Re: On Same form Add/Edit/Delete

Each button (add, edit) has its own algorithm in automatic mode. For example, the add button prepares the form for creating a new record. This clears all components on the form both visually and internally (record IDs, filters, etc.). Certain actions with the form also occur when you click the edit button.
The result of this is incorrect operation of your form.
You can get out of this situation by refusing automatic button functions and partial or complete emulation of the code in the script according to your work logic.

Re: On Same form Add/Edit/Delete

Hi Adam, Sparrow,
Perhaps you could try doing it something like the attached (in other words - cheat!  big_smile)
Maybe it gives you a few ideas.
Derek.

Post's attachments

Attachment icon oSFAED_01 cheat.zip 440.69 kb, 45 downloads since 2025-03-23 

6 (edited by AD1408 2025-03-23 06:49:22)

Re: On Same form Add/Edit/Delete

Hi Sparrow, Derek,
Looks like more complicated than I thought; what I was trying to achieve. I give up the idea of doing everything on same form when treeview is
involved.
Thank you very much for your help guys........

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

Re: On Same form Add/Edit/Delete

Hi Adam,
If you use Form2 with borderstyle = none and position Form2 appropriately over Form1, I'm not sure where there is much complexity.  I appreciate that it's not strictly using Form1 for adding/editing nodes on the tree but the end result is, as far as I can tell, the same.
Attached is an amendment to the earlier example with everything but the basic functionality stripped out.
Derek.

Post's attachments

Attachment icon oSFAED_01 basic.zip 439.83 kb, 41 downloads since 2025-03-23 

Re: On Same form Add/Edit/Delete

derek wrote:

Hi Adam,
If you use Form2 with borderstyle = none and position Form2 appropriately over Form1, I'm not sure where there is much complexity.  I appreciate that it's not strictly using Form1 for adding/editing nodes on the tree but the end result is, as far as I can tell, the same.
Attached is an amendment to the earlier example with everything but the basic functionality stripped out.
Derek.


Hi Derek,
Thank you very much........
It comes close enough what I was trying to do.
I guess it's complicated to do everything on form1.

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