<div dir="ltr">Thanks heaps guys. That's great.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 4, 2015 at 9:00 PM, Howard Page-Clark <span dir="ltr"><<a href="mailto:hdpc@talktalk.net" target="_blank">hdpc@talktalk.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 04/07/2015 09:46, Susie Nicol wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi - me again<br>
<br>
I have a Lazarus treeview, which I am populating from several sql queries.<br>
<br>
I add child nodes in this way, setting them to one of the fields<br>
returned from the query<br>
<br>
while Not SQLQuery1.EOF do<br>
Begin<br>
<br>
treeview1.items.addchild(treeview1.selected,<br>
SQLQuery1.fields[0].AsString);<br>
<br>
SQLQuery1.Next<br>
end;<br>
<br>
That works of course.<br>
<br>
I want to modify the newly added node by setting its data property to<br>
another field in the loop - something like<br>
<br>
treeview1.SOMETHING.data := Pointer(SQLQuery1.fields[1].AsInteger);<br>
<br>
but the problem is that I can't work out how to identify the newly-added<br>
child node. Is it possible?<br>
</blockquote>
<br></div></div>
var<br>
node: TTreeNode;<br>
begin<br>
node:=TreeView1.Items.AddChild(TreeView1.Selected,SQLQuery1.Fileds[0].AsString);<br>
node.Data:=pointer(SQLQuery1.Fields[0].AsInteger);<br>
SQLQuery1.Next;<br>
end;<br>
<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
<a href="https://www.avast.com/antivirus" rel="noreferrer" target="_blank">https://www.avast.com/antivirus</a><br>
<br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" rel="noreferrer" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</blockquote></div><br></div>