Carlo Hermus
How to make a treeview with parents January 07, 2010 12:55AM |
SELECT Contacts.ID AS ID, Contacts.IDParent AS IDParent, Contacts.Name AS Name, Contacts.IsDeleted AS IsDeleted, Contacts.IDIcon AS IDIcon FROM Contacts ORDER BY IDParent ASC
My Query sRoot is string sTrash is string sInbox is string sParentNode is string sRoot = "Categories" sTrash = "Deleted Items" sParentNode = "" TreeDeleteAll(TREE_CONTACTS) HReadSeek(Icons,ID,1,hIdentical) TreeAdd(TREE_CONTACTS,sRoot,Icons.Icon,Icons.Icon,0) HReadSeek(Icons,ID,-11,hIdentical) TreeAdd(TREE_CONTACTS,sTrash,Icons.Icon,Icons.Icon,-11) HExecuteQuery(QRY_TreeContacts) HReadFirst(QRY_TreeContacts) WHILE NOT HOut() HReadSeek(Icons,ID,QRY_TreeContacts.IDIcon,hIdentical) sParentNode = QRY_TreeContacts.Name IF NOT QRY_TreeContacts.IDParent = 0 THEN sParentNode = TreeFind(TREE_CONTACTS, QRY_TreeContacts.IDParent) TreeAdd(TREE_CONTACTS,sParentNode+TAB+QRY_TreeContacts.Name,Icons.Icon,Icons.Icon,QRY_TreeContacts.ID,tvAlphaSort+tvAcceptDuplicate) ELSE IF NOT QRY_TreeContacts.IsDeleted THEN TreeAdd(TREE_CONTACTS,sRoot+TAB+QRY_TreeContacts.Name,Icons.Icon,Icons.Icon,QRY_TreeContacts.ID,tvAlphaSort+tvAcceptDuplicate) ELSE IF QRY_TreeContacts.IsDeleted THEN TreeAdd(TREE_CONTACTS,sTrash+TAB+QRY_TreeContacts.Name,Icons.Icon,Icons.Icon,QRY_TreeContacts.ID,tvAlphaSort+tvAcceptDuplicate) END END HReadNext(QRY_TreeContacts) END TreeSort(TREE_CONTACTS,sRoot,tvUp)
Alexander S.
Re: How to make a treeview with parents January 27, 2013 09:00PM |
Carlo Hermus
Re: How to make a treeview with parents January 31, 2013 04:28PM |