Hi
I have a list of items from different parent nodes. I just need to avoid those nodes whose any of the ancestors have a particular checkbox checked. (for eg: hide checkbox)
Not just the parent, any of the ancestor nodes should not be hidden.
Is there any LINQ code?
-Thanks
I'm not sure I understand excactly what you are trying to do. But sounds like you want to use a LINQ expression to get an array of certain ancestors that meets certain requirements. If a checkbox alias is "hideNode" you could do something a like:
Or use AncestorsOrSelf if you want to include the current node.
Then get the items from only the allowed nodes.
The other way around as you describe it is also possible but not as simple and I would need more information to come up with a suggestion for that.
Thanks Frank,
I want to select various nodes from a list based on the value from ancestor nodes.
Suppose any of the ancestors of an item has a particular field checked as hidden, then that item will be filtered out.
-Arun
Check value exists in any of the Ancestor nodes
Hi
I have a list of items from different parent nodes.
I just need to avoid those nodes whose any of the ancestors have a particular checkbox checked. (for eg: hide checkbox)
Not just the parent, any of the ancestor nodes should not be hidden.
Is there any LINQ code?
-Thanks
Hi Arun
I'm not sure I understand excactly what you are trying to do. But sounds like you want to use a LINQ expression to get an array of certain ancestors that meets certain requirements. If a checkbox alias is "hideNode" you could do something a like:
Or use AncestorsOrSelf if you want to include the current node.
Then get the items from only the allowed nodes. The other way around as you describe it is also possible but not as simple and I would need more information to come up with a suggestion for that.
Best regards Frank
Thanks Frank,
I want to select various nodes from a list based on the value from ancestor nodes. Suppose any of the ancestors of an item has a particular field checked as hidden, then that item will be filtered out.
-Arun
So something like
This filters out all items in the list that has an acestor with the propert "alias" checked.
Thanks, Frank,
This is what exactly I wanted.
Thanks a lot
-Arun
is working on a reply...