shaunhubbs
Technical User
Hi all,
Am I under the correct impression that when setting the .sort property on a treeview to true that it is sorted alphabetically? The problem I am running into is that it seems to only sort alphabetically on the root set of nodes. In my application the root is always a SET of instruments and below the SET as children are the items (instruments, etc.).
Here is an example:
Set name #1
-- Item 7543525
-- Item 7543530
-- Item 7543540
-- Item 7543545
-- Item 7543550
-- Item 7543535 <-- I added this last node after the other ones, but it does not sort to its proper position which should be the third child in the list.
(NOTE: I did try a resort by turning the .sort property for the treeview to false and then true and also tried reloading the form to make sure it was not one of those simple things.)
I thought I had read somewhere that when the nodes are numeric it only sorts the first digit, but I added the number "6543535" underneath and that only sorted to the bottom as well.
On the root node, however, I did add a set name that should come before the current ones in the list and it sorted to the top where it should. Same for a set name that should come after; it was sorted to the bottom. (???)
Any ideas on how VB handles this treeview sort that might help out? Know a good way to write a function that could reindex the children nodes if they are, in fact, sorted by index if they are not on the root?
Thanks.
- Shaun
Am I under the correct impression that when setting the .sort property on a treeview to true that it is sorted alphabetically? The problem I am running into is that it seems to only sort alphabetically on the root set of nodes. In my application the root is always a SET of instruments and below the SET as children are the items (instruments, etc.).
Here is an example:
Set name #1
-- Item 7543525
-- Item 7543530
-- Item 7543540
-- Item 7543545
-- Item 7543550
-- Item 7543535 <-- I added this last node after the other ones, but it does not sort to its proper position which should be the third child in the list.
(NOTE: I did try a resort by turning the .sort property for the treeview to false and then true and also tried reloading the form to make sure it was not one of those simple things.)
I thought I had read somewhere that when the nodes are numeric it only sorts the first digit, but I added the number "6543535" underneath and that only sorted to the bottom as well.
On the root node, however, I did add a set name that should come before the current ones in the list and it sorted to the top where it should. Same for a set name that should come after; it was sorted to the bottom. (???)
Any ideas on how VB handles this treeview sort that might help out? Know a good way to write a function that could reindex the children nodes if they are, in fact, sorted by index if they are not on the root?
Thanks.
- Shaun