Susie,

You may find the code for TIBTreeView in the IBX for Lazarus package as a useful example of how to create a data aware treeview. Even you don't want to use IBX, the overall approach should work with other DB packages.

Tony Whyman
MWA

On 04/07/15 09:46, Susie Nicol wrote:
Hi - me again

I have a Lazarus treeview, which I am populating from several sql queries.

I add child nodes in this way, setting them to one of the fields returned from the query

           while Not SQLQuery1.EOF do
          Begin

treeview1.items.addchild(treeview1.selected, SQLQuery1.fields[0].AsString);

           SQLQuery1.Next
          end;

That works of course.

I want to modify the newly added node by setting its data property to another field in the loop - something like

    treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);

but the problem is that I can't work out how to identify the newly-added child node. Is it possible?

Thanks in advance
Susie
------
Susie K Nicol
Christchurch
New Zealand.


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to