Progress® Telerik® Reporting R3 2021

ElementTreeHelper.FindChildByName 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)


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


Type: Telerik.Reporting.ProcessingLayoutElement
The parent element to search within.
Type: SystemString
The name to search for.
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


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;

Version Information

Supported in: 1.0.1

See Also

In this article
Not finding the help you need?