<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Susie,<br>
    <br>
    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.<br>
    <br>
    Tony Whyman<br>
    MWA<br>
    <br>
    <div class="moz-cite-prefix">On 04/07/15 09:46, Susie Nicol wrote:<br>
    </div>
    <blockquote
cite="mid:CAG_R8duxTcqMX0yXstAAavFDiF110h7jPUFRXkwN8vBGAyMvhA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>Hi - me again<br>
                            <br>
                          </div>
                          I have a Lazarus treeview, which I am
                          populating from several sql queries.<br>
                          <br>
                        </div>
                        I add  child nodes in this way, setting them to
                        one of the fields returned from the query<br>
                        <br>
                                   while Not SQLQuery1.EOF do<br>
                                  Begin<br>
                         <br>
                                 
                        treeview1.items.addchild(treeview1.selected,
                        SQLQuery1.fields[0].AsString);<br>
                          <br>
                                   SQLQuery1.Next<br>
                                  end;     <br>
                        <br>
                      </div>
                      That works of course.<br>
                      <br>
                    </div>
                    I want to modify the newly added node by setting its
                    data property to another field in the loop -
                    something like <br>
                    <br>
                        treeview1.SOMETHING.data :=
                    Pointer(SQLQuery1.fields[1].AsInteger);<br>
                    <br>
                  </div>
                  but the problem is that I can't work out how to
                  identify the newly-added child node.  Is it possible?<br>
                  <br>
                </div>
                Thanks in advance<br>
              </div>
              Susie<br>
              ------<br>
            </div>
            Susie K Nicol<br>
          </div>
          Christchurch<br>
        </div>
        New Zealand.<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>