Disable Enter Key in Grid Inline Edit

1 Answer 39 Views
Grid TextArea
Kinga
Top achievements
Rank 1
Kinga asked on 29 Jul 2022, 08:57 AM

Hello,

How can i disable default Enter Key behaviour in Inline Grid Edit?

I need to place an TextArea component inside a inline edit row to let user put longer text description in one of the columns. When i try to go to a new line inside TextArea component, clicking enter key is triggering save for the whole inline edit row, making use of TextArea impossible.

Could you help me find a solution for this problem?

Kind regards,

Kinga

 

 

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Dimo
Telerik team
answered on 02 Aug 2022, 07:55 AM

Hello Kinga,

I assume you have a column EditorTemplate. Wrap the TextArea with a <div> that captures key events and prevents their propagation:

<GridColumn Field="@nameof(Product.Description)" Title="Product Description">
    <EditorTemplate>
        @{
            var p = context as Product;
        }
        <div @onkeydown:stopPropagation>
            <TelerikTextArea @bind-Value="@p.Description" />
        </div>
    </EditorTemplate>
</GridColumn>

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Kinga
Top achievements
Rank 1
commented on 02 Aug 2022, 08:09 AM

Thank you,

this is exactly what i needed

 

Regards,

Kinga

 

Tags
Grid TextArea
Asked by
Kinga
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or