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

Dropdownlist will not dropdown

3 Answers 296 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 04 Oct 2019, 10:56 PM

 I have tried to implement the dropdownlist and the data is being populated to the control, but the control will not dropdown when selected on.

I have tried to changed from Server/Prerender and also tried a static list. I also have the same issues with Telerik menus. What do I have configured wrong.

Running Blazor UI 2.1.1

<TelerikDropDownList Data="@DropDownListData" @bind-Value=@SelectedValue ValueField="ID" TextField="Organization">

</TelerikDropDownList>

<br />Selected product: @SelectedValue



@code {

    public IEnumerable<OrgModel> DropDownListData { get; set; }

    public int SelectedValue { get; set; } = 3;

    WeatherForecast[] forecasts;
    OrgModel[] Orgs;

    protected override async Task OnInitializedAsync()
    {
        forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
        DropDownListData = await OrgService.Get_OrgList_Async();
    }

    //protected async Task OnAfterRenderAsync()
    //{
    //    forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
    //    DropDownListData = await OrgService.Get_OrgList_Async();
    //}

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Oct 2019, 08:51 AM

Hello Robert,

There is nothing obviously wrong in this snippet and my best guess is that one of the following issues is manifesting in the project:

Both will cause errors in the console, so you can monitor it to see the details.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
0
Robert
Top achievements
Rank 1
answered on 07 Oct 2019, 12:45 PM
Thank you for the help and pointing me the in the right direction. I was fetching the incorrect JS interop file. 
0
BitShift
Top achievements
Rank 1
Veteran
answered on 30 Oct 2019, 02:30 PM
Glad I found this thread, I was running into the same issue.
Tags
DropDownList
Asked by
Robert
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Robert
Top achievements
Rank 1
BitShift
Top achievements
Rank 1
Veteran
Share this question
or