ElementTreeHelper
Provides utility methods that perform common tasks involving nodes in a LayoutElement tree.
Definition
Namespace:Telerik.Reporting.Processing
Assembly:Telerik.Reporting.dll
Syntax:
public static class ElementTreeHelper
Inheritance: objectElementTreeHelper
Methods
Determines whether a parent layout element contains immediate child having a specified name.
public static bool ContainsChildWithName(LayoutElement parent, string name)
The parent element to search within.
namestringThe name to search for.
Returns:bool
true if an layout element having the specified parent and name is found; Otherwise, false.
Searches for all layout elements with a specified name within a specified parent.
public static LayoutElement[] FindChildByName(LayoutElement parent, string name, bool searchAllChildren)
The parent element to search within.
namestringThe name to search for.
searchAllChildrenboolIf true, all descendants within the specified parent are matched (deep search). Otherwise, only immediate children are matched.
Returns:Array containing all matching by name children / descendants. If no elements are found an empty array is returned
Returns the immediate child layout element within a specified parent at specified index.
public static LayoutElement GetChildByIndex(LayoutElement parent, int index)
The parent element to search within.
indexintThe zero-based index of the child to get.
Returns:Layout element having the specified parent at the specified index.
Returns the first immediate child layout element within a specified parent having a specified name.
public static LayoutElement GetChildByName(LayoutElement parent, string name)
The parent element to search within.
namestringThe name to search for.
Returns:Layout element having the specified name and parent.
GetChildElements(LayoutElement)
IEnumerable<LayoutElement>
Returns all immediate child layout elements within a specified parent.
public static IEnumerable<LayoutElement> GetChildElements(LayoutElement parent)
The parent element.
Returns:IEnumerable<LayoutElement>
Enumerable of all layout elements having the specified parent. If the parent does not have children, an empty enumeration is returned.
Returns the zero-based index of the first occurrence of a layout element with a specified name within a parent.
public static int IndexOfChildWithName(LayoutElement parent, string name)
The parent element to search within.
namestringThe name to search for.
Returns:int
The zero-based index of the first occurrence of a layout element having the specified name within the specified parent.