Recent

Author Topic: Treeview with each item having a Memo... is this Possible  (Read 693 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Treeview with each item having a Memo... is this Possible
« on: August 05, 2019, 01:19:53 pm »
Is it even possible to have a Memo text attached to each and every node in TreeView

Example....

Root    (has a memo attached)
 -- Node One         (has a memo attached)
        -- Child one            (has a memo attached)


Each item in the treview could have a Memo not attached.

Of course data would be save in a binary file for each TreeView item with each txt string

Possible?
If so, what do i need to know to hook it up?

Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

sfeinst

  • Full Member
  • ***
  • Posts: 186
Re: Treeview with each item having a Memo... is this Possible
« Reply #1 on: August 05, 2019, 02:16:01 pm »
Yes it can.  Each treenode can have a data object associated with it (Data property of the treenode).  Though it may be possible to store just the text, I recommend you create an object that has as one of its attributes, the text.  This way you can associate other items with the text (in my case a key for the database where I stored the text).  Then when you change which node is active (the tree's selectionchange), you get the object from the current node, assign the text to the memo control.

On changes to the memo, copy the text from the memo to the text attribute of the object of the current node.

You will want to read up on:
treenodes and assigning and getting objects from the Data property.
change event of a tree
change event of a memo

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: Treeview with each item having a Memo... is this Possible
« Reply #2 on: August 05, 2019, 02:48:18 pm »
Yes it can.  Each treenode can have a data object associated with it (Data property of the treenode).  Though it may be possible to store just the text, I recommend you create an object that has as one of its attributes, the text.  This way you can associate other items with the text (in my case a key for the database where I stored the text).  Then when you change which node is active (the tree's selectionchange), you get the object from the current node, assign the text to the memo control.

On changes to the memo, copy the text from the memo to the text attribute of the object of the current node.

You will want to read up on:
treenodes and assigning and getting objects from the Data property.
change event of a tree
change event of a memo

Cool... that is good info.
Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

Thaddy

  • Hero Member
  • *****
  • Posts: 10274
Re: Treeview with each item having a Memo... is this Possible
« Reply #3 on: August 05, 2019, 05:09:30 pm »
Note I would not store a Tmemo in the data/objects, but a Tstringlist and use just one Tmemo.
I am more like donkey than shrek

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: Treeview with each item having a Memo... is this Possible
« Reply #4 on: August 06, 2019, 07:36:28 pm »
Note I would not store a Tmemo in the data/objects, but a Tstringlist and use just one Tmemo.

Yeah... that is what I want to do
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

Possum

  • Jr. Member
  • **
  • Posts: 58
    • uDoPage
Re: Treeview with each item having a Memo... is this Possible
« Reply #5 on: December 09, 2019, 12:19:24 am »
I want to do the same..

Have you any code you could share with me..

Thx

jamie

  • Hero Member
  • *****
  • Posts: 3249
Re: Treeview with each item having a Memo... is this Possible
« Reply #6 on: December 09, 2019, 02:05:58 am »
there are in place editors that work in the nodes, I think there is a Combobox type and Edit type..

I believe there is a base class where you can create some custom editors of your own that will drop into the nodes..

 Its been a while since I've looked in there but I do remember that. the base class has the required members that you implement.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018