I'm not sure, but I would think you have to loop through the children collection of a parent node in order to get their id's. How about a little linq, maybe? This is not tested, just written straight in the editor :-)
var test = (from childnode in parent.Children
select childnode.Id).ToList();
Still, i'm not too sure if using the linq query is actually faster than using a foreach loop. There's a lot of tests out there that shows that linq queries performs worse than a simple foreach. You might check up on that and save some overhead where it can be saved :-)
Getting childnodeids
Is there a way to get an array of all childnodeids without having to iterate over all nodes in the Children-collection?
thanks
Thomas
Hi Thomas,
I'm not sure, but I would think you have to loop through the children collection of a parent node in order to get their id's. How about a little linq, maybe? This is not tested, just written straight in the editor :-)
/ Bo
Hi Bo
thanks - it worked :-)
Glad it worked!
Still, i'm not too sure if using the linq query is actually faster than using a foreach loop. There's a lot of tests out there that shows that linq queries performs worse than a simple foreach. You might check up on that and save some overhead where it can be saved :-)
/ Bo
is working on a reply...