Component in GridColumn Template

3 posts, 1 answers
  1. Atif
    Atif avatar
    2 posts
    Member since:
    Nov 2015

    Posted 24 Feb 2020 Link to this post

    I have added Component in <TelerikGrid>/<GridColumn>/<Template>. Grid is loading based on data in a text field. All columns are getting update except column having component.

     

    <GridColumns>
            <GridColumn Field="@(nameof(Fee.FEE_ID))" Title="STD">
                <Template>
                    @{
                        Fee Fee = context as Fee;
                        <RTP_SMS.Pages.Components.CompStdNN id="@Fee.FEE_ID"></RTP_SMS.Pages.Components.CompStdNN>
                    }
                </Template>
            </GridColumn>
     </GridColumns>

     

  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    5937 posts

    Posted 24 Feb 2020 Link to this post

    Hello Atif,

    Can you confirm that the CompStdNN uses the OnParametersSet/OnParametersSetAsync event to update? Once instantiated the first time in the grid, if the grid data changes, the child component will only receive new parameters, it will not initialize from scratch, so logic running in the OnInitialized event will not fire.

     

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
  3. Atif
    Atif avatar
    2 posts
    Member since:
    Nov 2015

    Posted 24 Feb 2020 in reply to Marin Bratanov Link to this post

    I did not added OnParametersSet or OnParametersSetAsync, but after adding it resolved issue.

     

    Thanks for quick response.

Back to Top