This is a migrated thread and some comments may be shown as answers.

OnUpdate Not Being Triggered from within EditorTemplate

2 Answers 704 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Veteran
Doug asked on 16 Aug 2020, 01:44 AM

I can successfully trigger the OnUpdate event from a simple GridColumn Field update with Incell editing but not when using an EditorTemplate. Any ideas what I'm doing wrong or missing?

<TelerikGrid Data=@ItemsOC
             EditMode="@GridEditMode.Incell"
             OnUpdate="@UpdateHandler">
    <GridColumns>
         
        <!-- This column DOES NOT trigger OnUpdate when edited. -->
        <GridColumn Field="Quantity" Title="EDIT Quantity">
            <EditorTemplate>
                @{
                    ItemToEdit = context as Item;
                    <TelerikNumericTextBox @bind-Value="@ItemToEdit.Quantity" Format="F2" />
                }
            </EditorTemplate>
        </GridColumn>
 
        <!-- This column DOES trigger OnUpdate when edited. -->
        <GridColumn Field="Quantity" />
 
        <GridColumn Field="Description" />
        <GridColumn Field="Cost" />
        <GridColumn Field="SubTotal" />
    </GridColumns>
</TelerikGrid>

 

Doug

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 16 Aug 2020, 06:13 AM

Hi Doug,

When using the editor template, the grid can't know what's happening in there, so the app (the template) must take care to close the cell for editing and to update the data. You can read more about this and find examples in the Notes section of the InCell editing article: https://docs.telerik.com/blazor-ui/components/grid/editing/incell#notes

 

Regards,
Marin Bratanov
Progress Telerik

0
Doug
Top achievements
Rank 1
Veteran
answered on 16 Aug 2020, 05:46 PM

Thanks Marin. That got me on track!

Doug

Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Doug
Top achievements
Rank 1
Veteran
Share this question
or