binding inside contextmenu does not work

1 Answer 104 Views
ContextMenu
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Claudio asked on 29 Mar 2023, 02:55 PM

Hi, i show in a specific position a context menu with some fields.

If i try to update a binding field (using @bind-Value),

for example with a TelerikTextBox it does not work.

You can see this simple example, press Reset button does not update the textbox content.

What's wrong?

Thanks

 

https://blazorrepl.telerik.com/QxkRwDbe51q1XmYf53

 

 

<TelerikContextMenu@ref="ContextMenu"TItem="object">

  
    <Template>
        <div>Input name</div>
        <TelerikTextBox @bind-Value="Value" />
        <br />
        <TelerikButton OnClick="@(() => Value = "")">Reset</TelerikButton>
        <TelerikButton OnClick="@(() => ContextMenu.HideAsync())">Close</TelerikButton>
    </Template>
</TelerikContextMenu>
<TelerikButton OnClick="() => ContextMenu.ShowAsync(100,100)">Open context menu</TelerikButton>
@code
{
    private TelerikContextMenu<object> ContextMenu {get;set;}
    private string Value {get;set;}
}

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 03 Apr 2023, 01:27 PM

Hi Claudio,

Thank you for sending a runnable sample. I'm reproducing the described behavior with it.

The problem in this scenario is due to a missing Refresh method in the ContextMenu. Thus, I opened a feature request on your behalf for that method: Refresh Method.

As implementing the Refresh method is a quick enhancement, I will personally engage to include this feature in our next release 4.2 expected to come out on the 26th of April.

You are automatically subscribed as a creator to receive email notifications for status updates.

Regards,
Hristian Stefanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ContextMenu
Asked by
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Hristian Stefanov
Telerik team
Share this question
or