Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looping elements in treeview (6.0)

    +AREA1
    +AG1
    +sett1
    a
    b
    c
    +sett2
    k
    l
    o
    +sett1
    a
    b
    c
    +sett8
    k
    l
    o
    +AG9
    +sett1
    a
    b
    c
    +sett2
    k
    l
    o
    +sett1
    a
    b
    c
    +AREA2
    +AG7
    +setta
    a
    b
    +settb
    f
    b
    k
    +AG9
    +sett8
    3
    8
    +settk
    f
    b
    k
    +AREA3
    .....


    This is my treeview(!)

    Now the treeview is a tree of organization office
    AREA is the big root
    AG is the agency of AREA
    sett is a sub location og AG
    a. 3, 8, f... are the id of emploiess

    Now how to loop in treeview and count:
    How many AREA are in treview
    How many AG are in each AREA
    How many sett are in each AG
    How many item ID area for each sett

    In effect loop first AREA and count element, loop in second AREA....ecc

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Looping elements in treeview (6.0)

    Where do the data for the treeview come from? A database?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looping elements in treeview (6.0)

    Yes from a mdb...
    But i want to loop in treview when that is just filded with a data...
    or...if i understand you during the teeview is filled, in this case the code here:
    RSSQL2.MoveFirst
    Do Until RSSQL2.EOF
    sValue = Trim(RSSQL2.Fields("COD_AREA").value)
    sKey = "K" & sValue
    .Nodes.Add , , sKey, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE")), 1, 1
    sValue = "AG. - " & Trim(RSSQL2.Fields("SPORT").value)
    'sSQL = .Nodes.Count
    .Nodes.Add sKey, tvwChild, "L" & sValue, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE2")), 1, 2
    sKey = "L" & sValue
    sValue = "SETT. - " & Trim(RSSQL2.Fields("PROVA3"))
    SSQL = .Nodes.Count
    .Nodes.Add sKey, tvwChild, "M" & sKey & sValue, sValue, 1, 2
    sKey = "M" & sKey & sValue
    sValue = "COPE - " & Trim(RSSQL2.Fields("PROVA1"))
    .Nodes.Add sKey, tvwChild, "N" & sKey & sValue, sValue, 1, 2
    '.Nodes.Item(sKey).EnsureVisible
    RSSQL2.MoveNext
    'sSQL = .Nodes.Count
    Loop

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Looping elements in treeview (6.0)

    I'd execute queries on the database, that's much easier than traversing the treeview.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looping elements in treeview (6.0)

    very easy!
    For you;-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •