I have a bit of an unusual sorting need for the project I'm working on and I was wondering: is it possible to use the API to sort nodes in the content tree?
If not, I'll have to look at a different approach, but it would be super nice if this was possible.
Sorting nodes in content tree
I have a bit of an unusual sorting need for the project I'm working on and I was wondering: is it possible to use the API to sort nodes in the content tree?
If not, I'll have to look at a different approach, but it would be super nice if this was possible.
You can set the SortOrder Property of the Documents by api:
Cool! I'll have to loop through all the nodes myself and sort them, so no autosorting functions?
I think so, I think the autosorting feature is only in the backend.
Implement your own comparer (in this example sorting by Expiration Date):
and then compare the nodes:
hth, Thomas
Sweet! Thanks for taking the time to look that up Thomas. Not sure I can use this as I have some specific needs, but I'll look into it!
Gald I coudl help.
You can extend the Comparer with your own code. To compare some properties just compare them and return 1 for x > y, -1 for x<y and 0 for x = y
Thomas
Thanks for your posts, guys, they really helped me out. This is how I sorted my documents:
is working on a reply...