Progress® Telerik® Reporting R3 2017

ElementTreeHelperGetChildByIndex Method

Returns the immediate child layout element within a specified parent at specified index.

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

Syntax

public static LayoutElement GetChildByIndex(
	LayoutElement parent,
	int index
)

Parameters

parent
Type: Telerik.Reporting.ProcessingLayoutElement
The parent element to search within.
index
Type: SystemInt32
The zero-based index of the child to get.

Return Value

Type: LayoutElement
Layout element having the specified parent at the specified index.

Examples

This example shows how to access a child by index in a ItemDataBinding event handler.
void DetailSection_ItemDataBinding_Using_IndexOfChildWithName_And_GetChildByIndex(object sender, EventArgs e)
{
    Processing.DetailSection processingInstance = (Processing.DetailSection)sender;
    int index = Processing.ElementTreeHelper.IndexOfChildWithName(processingInstance, "textBox1");
    if (index >= 0)
    {
        Processing.LayoutElement child = Processing.ElementTreeHelper.GetChildByIndex(processingInstance, index);
        Processing.VisualElement visualChild = child as Processing.VisualElement;
        if (null != visualChild)
        {
            visualChild.Style.BackgroundColor = System.Drawing.Color.Blue;
        }
    }
}

See Also