Progress® Telerik® Reporting R2 2018

ElementTreeHelperIndexOfChildWithName Method

Returns the zero-based index of the first occurrence of a layout element with a specified name within a parent.

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

Syntax

public static int IndexOfChildWithName(
	LayoutElement parent,
	string name
)

Parameters

parent
Type: Telerik.Reporting.ProcessingLayoutElement
The parent element to search within.
name
Type: SystemString
The name to search for.

Return Value

Type: Int32
The zero-based index of the first occurrence of a layout element having the specified name within the specified parent.

Examples

This example shows how to get the index of a child 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

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy