Hi.
I'm trying to setFocus to a RadzenDropDown, but whatever I try I'm not able to get the reference:
I'm using RadzenDD in many places in my pages, but in this case I have to ensure user has selected a value, and if not focus him to that particular component. By the way I already have other dropdowns in the same page, but they don't have a mandatory value for my db.
<RadzenDropDown AllowClear="true" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
Data=@folderList @bind-Value=@Resource.IdResource Placeholder="Select Folder..." TValue="string"
TextProperty="folderList.EntryDescri" ValueProperty="folderList.IdEntry" Name="rFolder" @ref="rFolder"
Change=@(args => SelectDdl(args, "EntryFolder")) Class="w-100" />
...
@code {
RadzenDropDown<string> rFolder;
...
if (String.IsNullOrEmpty(Resource.FolderName))
{
await _js.ToastrError("Select Resource Folder");
rFolder.Element.FocusAsync();
return;
}
I'm stuck on the declaration of the DropDown in the page.