Skip to content

Capture references to multiple similar child-components #13358

@harleydk

Description

@harleydk

I was searching for documentation on how to capture references to child-components based on for-each creation.
Let's say I have a parent-component which itereates a collection to create multiple child-components:

@foreach (var singleDataPiece in aCollectionOfData)
{
    <SubComponent Id="@singleDataPiece.Id" SingleDataPiece="@singleDataPiece"></SubComponent>
}

I would like to call a method on one of these sub-components, identified by its id-value. Would you consider adding documentation on this scenario?

Many thanks in advance for your consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Complete Blazor Webaffected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-razor.languageseverity-minorThis label is used by an internal tool

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions