Progress® Telerik® Reporting R3 2017

ElementTreeHelperFindChildByName Method

Searches for all layout elements with a specified name within a specified parent.

Namespace:  Telerik.Reporting.Processing
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

public static LayoutElement[] FindChildByName(
	LayoutElement parent,
	string name,
	bool searchAllChildren
)

Parameters

parent
Type: Telerik.Reporting.ProcessingLayoutElement
The parent element to search within.
name
Type: SystemString
The name to search for.
searchAllChildren
Type: SystemBoolean
If true, all descendants within the specified parent are matched (deep search). Otherwise, only immediate children are matched.

Return Value

Type: LayoutElement
Array containing all matching by name children / descendants. If no elements are found an empty array is returned

Examples

This example shows how to find all children with name in a ItemDataBinding event handler.
void DetailSection_ItemDataBinding_Using_FindChildByName(object sender, EventArgs e)
{
    Processing.DetailSection processingInstance = (Processing.DetailSection)sender;
    Processing.LayoutElement[] elements = Processing.ElementTreeHelper.FindChildByName(processingInstance, "textBox1", true);
    foreach (Processing.LayoutElement child in elements)
    {
        Processing.VisualElement visualChild = child as Processing.VisualElement;
        if (null != visualChild)
        {
            visualChild.Style.BackgroundColor = System.Drawing.Color.Blue;
        }
    }
}

See Also