TreeView: Sort Sequence = Load Sequence?

  • Thread starter (PeteCresswell)
  • Start date
P

(PeteCresswell)

I'm loading a TreeView control from a recordset that's sequenced by a date.

When I step through the code, I *think* I'm seeing the nodes created in the
expected sequence - but I'm starting to doubt my own sanity because, when the
tree is viewed, the dates are not in that sequence.

Instead, the tree appears to be sequenced alphabetically by the highest level
node names.

In the TreeCtrl.Properties, I see a checkbox labeled "Sorted" and have unchecked
it; but the problem persists.

How about it? Is it possible for the TreeView control to present itself with
high-level nodes arranged is a sequence other than the order in which they were
created?
 
D

Douglas J. Steele

Does your code set the Sorted property anywhere? You need to ensure that no
parent node has that property set: it's unfortunately not a "set it once for
the entire tree" property.
 
P

(PeteCresswell)

Per Douglas J. Steele:
Does your code set the Sorted property anywhere? You need to ensure that no
parent node has that property set: it's unfortunately not a "set it once for
the entire tree" property.

I only set it in the UI for the treeview's props.

Sounds like you may have nailed it for me.

I'm going to go back to the code and specify the Sorted property every time I
create a parent node.
 
P

(PeteCresswell)

Per Douglas J. Steele:
Does your code set the Sorted property anywhere? You need to ensure that no
parent node has that property set: it's unfortunately not a "set it once for
the entire tree" property.

I had sinned on two counts: My code was setting the TreeView's properties and I
was not setting .Sorted=False for individual nodes.

Fixed both and it ran A-OK.

Rem-d out the individual node settings and it still ran so I left it that way -
figuring that .Sorted defaults to False.


Thanks a lot!!!!

I'd spun my wheels for quite a few man hours trying to resolve this one.
 
D

Douglas J. Steele

(PeteCresswell) said:
Per Douglas J. Steele:

I had sinned on two counts: My code was setting the TreeView's properties
and I
was not setting .Sorted=False for individual nodes.

Fixed both and it ran A-OK.

Rem-d out the individual node settings and it still ran so I left it that
way -
figuring that .Sorted defaults to False.

Yeah, default is False.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top