I am trying to set the focus of a specific row field when I click on a different field to enter edit mode.
For instance,
In my tag I have a read only numeric field and when I click on that field I go into row edit mode. Then I want to focus on the field that is in the EditTemplate area. Looking at the code below you will see the read only RadzenNumeric in the Template tag. @onkeyup triggers the EditRow() function. Once the EditTemplate is rendered I want to focus on the RadzenNumeric field in the EditTemplate tag. I have tried all of the examples I could find but could not get it to focus.
I am referencing the field with ..
public RadzenNumeric<decimal?> FocusField { get; set; } = default!;
I used a simple @onmouseover="FunctionCall(FocusField)" and then used myFocusField.FocusAsync();
I even tried to do a Task.Delay(2000) and then the FocusAsync() call. The field still does not focus. The debugging in Visual Studio show the delay and the call but the field still doesn't focus.
Is there maybe a complete piece of code that shows the full function call with the FocusAsync()?
There are several posts about it in the forum, @korchev, some with no answers.
After several hours of searching, I did just find in the github code for the RadzenNumeric object that because of its nature you can't reference it with the fieldref.Element.FocusAsync() construct, instead you have to reference it with fieldref.FocusAsync().