Completed
Last Updated: 12 Sep 2019 04:50 by ADMIN
Walter Edwards
Created on: 11 Sep 2019 23:40
Category: DropDownList
Type: Feature Request
0
Add DropDownAutoWidth and DropDownWidth properties to TelerikDropDownList control

Add the ability to make the drop down list expanded contents wider than the closed control, or just automatically determine appropriate width (doesn't always work well for very long text fields, so you need both properties).

 

See:  https://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/dropdownconfigurator/defaultcs.aspx

 

1 comment
ADMIN
Marin Bratanov
Posted on: 12 Sep 2019 04:50

Hello Walter,

This feature is available - you can set the PopupWidth to "auto" which will appear as the style="width:auto" CSS rule in the DOM, and will let the popup be as wide as its contents.

Here's an example:

 

@using Telerik.Blazor.Components.DropDownList

<TelerikDropDownList Data="@MyList" @bind-Value="MyItem" PopupWidth="auto">
</TelerikDropDownList>

@code {
    protected List<string> MyList = new List<string>() { "first", "second", "lorem ipsum dolor sit amet", "third" };

    protected string MyItem { get; set; } = "second";
}

 

Here's also a data source for a wide item:

 

    protected List<string> MyList = new List<string>() { "first", "second", "lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet", "third" };

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor