Completed
Last Updated: 20 Jun 2024 14:11 by Brian
Release 5.0.0 (15 Nov 2023) (R1 PI1)

I have a ComboBox/DropDownList that gets data from a remote service, using virtualization. When the PageSize property is big enough (in my case 20), I have issues scrolling up the selection box dropdown list. I'm trying to scroll but then resets to the currently selected item making it almost impossible to scroll up. You can use your own demo examples to replicate this issue.

To reproduce the issue, try the ComboBox - Virtualization, in Telerik REPL (Demo), change the PageSize from 10 to 20. Open the dropdown and select an item. Then, open again the dropdown and scroll slowly up.

Completed
Last Updated: 06 Dec 2022 09:39 by ADMIN
Release 4.0.0 (18 Jan 2023) (R1 2023)
Created by: Andrew
Comments: 2
Category: ComboBox
Type: Feature Request
29

I would like to change the text in the ComboBox dropdown when there is no data in the source collection.

At the moment the only option is through localization for all instances like here.

Unplanned
Last Updated: 05 Mar 2024 12:10 by ADMIN

I am working on a form where experienced agents need to input data quickly. Often enough they know the codes and so they can type them in the combo box, but they shouldn't have to look for the mouse to select the item, the combo box should select it when the user presses Tab to move to the next field.

This should happen only when the user has filtered the combo box so they see some items (and so the dropdown is open) - I want them to be able to select only items from the available options, AllowCustom does not work for me.

---

ADMIN EDIT

Here is one workaround you can consider:

https://blazorrepl.telerik.com/QoOAPyEZ233YP2AX19

@inject IJSRuntime js

@* Move this script to a separate JS file *@
<script suppress-error="BL9992">
    function getHighligtedComboItem() {
        // Get the currently focused item in this particular ComboBox.
        var focusedItem = document.querySelector(".select-on-tab .k-list-item.k-focus");
        if (focusedItem) {
            return focusedItem.innerText;
        }
    }
</script>

<p>FirstFilteredItem: @FirstFilteredItem</p>

<p>Selected value: @ComboBoxValue</p>

<span onkeyup="@GetFirstFilteredItem">
    <TelerikComboBox Data="@ComboBoxData"
                     Value="@ComboBoxValue"
                     ValueChanged="@( (int newValue) => ComboBoxValueChanged(newValue) )"
                     TextField="@nameof(ListItem.Text)"
                     ValueField="@nameof(ListItem.Value)"
                     Filterable="true"
                     FilterOperator="@StringFilterOperator.Contains"
                     OnBlur="@SelectItemOnTab"
                     OnOpen="@( () => IsComboBoxOpen = true )"
                     OnClose="@( () => IsComboBoxOpen = false )"
                     Placeholder="Select an item..."
                     ClearButton="true"
                     Width="200px">
        <ComboBoxSettings>
            <ComboBoxPopupSettings Class="select-on-tab" />
        </ComboBoxSettings>
    </TelerikComboBox>
</span>

<input placeholder="another form element" />

@code {
    private IEnumerable<ListItem> ComboBoxData = Enumerable.Range(1, 123).Select(x => new ListItem { Text = "Item " + x, Value = x });

    private int ComboBoxValue { get; set; }

    private string FirstFilteredItem { get; set; } = string.Empty;

    private bool IsComboBoxOpen { get; set; }

    private async Task GetFirstFilteredItem(KeyboardEventArgs args)
    {
        if (!IsComboBoxOpen)
        {
            // Wait at least 300ms, which is the opening animation.
            await Task.Delay(400);
        }
        else
        {
            // Wait, depending on the typical filtering time.
            await Task.Delay(300);
        }

        // The code that will find the item text depends on the exact scenario and potential use of ItemTemplate.
        FirstFilteredItem = await js.InvokeAsync<string>("getHighligtedComboItem");
    }

    private void SelectItemOnTab()
    {
        if (!string.IsNullOrEmpty(FirstFilteredItem))
        {
            // Match the filter operation to the filter operator of the ComboBox.
            var matchingItem = ComboBoxData.Where(x => x.Text.ToLowerInvariant().Contains(FirstFilteredItem.Trim().ToLowerInvariant())).FirstOrDefault();
            if (matchingItem != null)
            {
                ComboBoxValue = matchingItem.Value;
                FirstFilteredItem = string.Empty;
            }
        }
    }

    private void ComboBoxValueChanged(int newValue)
    {
        ComboBoxValue = newValue;
        FirstFilteredItem = string.Empty;
    }

    public class ListItem
    {
        public int Value { get; set; }
        public string Text { get; set; } = string.Empty;
    }
}

 

Completed
Last Updated: 07 May 2021 11:06 by ADMIN
Release 2.24.0
Created by: ben
Comments: 4
Category: ComboBox
Type: Feature Request
25

Transitioning our application from Telerik React to Blazor, our comboboxes in our React application are hooked up to OData endpoints because of the amount of data they could display, some as large as 30mb of json.

Server filtering, https://feedback.telerik.com/blazor/1447481-server-filtering-with-custom-data-request-event-that-can-accommodate-remote-data, almost works, however:

  • I can't set PageSize on the combobox
  • I can't set TotalCount on the combobox
  • Using Telerik.Blazor.ExtensionMethods.ToOdataString throws a NullReferenceException when I try to use it in the ReadItems method with the ComboBoxReadEventArgs args.Reqeuest.ToOdataString()

I tried setting up my combobox like my OData Grid, i.e.


<TelerikComboBox Data="@Dtos"
                         OnRead="@ReadItems"
                         Filterable="true"
                         Placeholder="Find what you seek by typing"
                         @bind-Value="@SelectedValue"
                         TextField="Name" 
                         ValueField="Id"
                         Pageable="true" 
                         PageSize="20" 
                         TotalCount=@Dtos.Count
                         >

However it throws an exception:

blazor.webassembly.js:1 WASM: System.InvalidOperationException: Object of type 'Telerik.Blazor.Components.TelerikComboBox`2[[MyType, MyNamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' does not have a property matching the name 'Pageable'.

Was hoping this would 'just work' like it does with the Grid, which is amazing!

Completed
Last Updated: 25 Mar 2020 13:28 by ADMIN
Release 2.10.0

ComboBox value binding broken in 2.9.0, works fine in 2.8.0

Please see your own documentation example:

<TelerikComboBox Data="@MyList" @bind-Value="MyItem">
</TelerikComboBox>

@code {
    protected List<string> MyList = new List<string>() { "first", "second", "third" };
    protected string MyItem { get; set; } = "second";
}


Unplanned
Last Updated: 08 May 2020 08:57 by ADMIN
Created by: ben
Comments: 8
Category: ComboBox
Type: Feature Request
6

Related to https://docs.telerik.com/blazor-ui/knowledge-base/grid-bind-navigation-property-complex-object

However I'm looking to do this for the Combobox, i.e.

<TelerikComboBox Data="@Users"                               
                                 @bind-Value="@FormElement.UserInitials"
                                 ValueField="Dto.UserInitials"                                 
                                 TextField="Dto.UserInitials"
               >
</TelerikComboBox>

 

public class Users

{

   //bunch of properties 

   public UserSubProperties Dto {get; set;}

}

 

public class UserSubProperties

{

   public string UserInitials {get; set;}

}

Completed
Last Updated: 25 Dec 2023 13:27 by ADMIN
Release 5.1.0 (31 Jan 2024) (R1 2024)

The popup window is not closed when the ComboBox is disabled from code.

Reproduction code:

 

Selected value: @selectedValue
<br />

<TelerikComboBox Data="@myComboData"
                 TextField="MyTextField"
                 ValueField="MyValueField"
                 Value="selectedValue"
                 ValueChanged="@((int value) => ValueChangedHandler(value))"
                 Placeholder="Select an item..."
                 ClearButton="true"
                 Enabled="@isEnabled"
                 Filterable="true">
</TelerikComboBox>

@code {
    public bool isEnabled { get; set; } = true;
    IEnumerable<MyDdlModel> myComboData = Enumerable.Range(1, 20).Select(x => new MyDdlModel { MyTextField = "item " + x, MyValueField = x });

    int selectedValue { get; set; } = 3; //usually the current value should come from the model data

    public async Task ValueChangedHandler(int value)
    {
        isEnabled = false;
        await Task.Delay(4000); //simulate network delay

        selectedValue = value;

        isEnabled = true;
    }

    //in a real case, the model is usually in a separate file
    //the model type and value field type must be provided to the dropdpownlist
    public class MyDdlModel
    {
        public int MyValueField { get; set; }
        public string MyTextField { get; set; }
    }
}

 

Completed
Last Updated: 28 Mar 2023 14:49 by ADMIN
Release 4.2.0 (04/26/2023)

When selecting an item with the Enter key, the value is not displayed in the input field.

Reproduction
  1. Open this REPL example
  2. Open the ComboBox and navigate with the arrows to any item
  3. Hit "Enter" to select the item

The item is selected, but its value is not displayed inside the input field.

===

The issue is also reproducible with the MultiColumnComboBox component. 

Unplanned
Last Updated: 24 May 2022 13:45 by ADMIN
Created by: Harrison
Comments: 1
Category: ComboBox
Type: Feature Request
6

Hi Telerik Team,

One of the requirements for my team project is that the ComboBox needs to be sorted in descending order to list dates. We need to sort the groups and the options inside the groups.

Ideally, the ComboBox can have a SortDirection parameter that defines the order as SortAscending or SortDescending, and can display the ComboBox groups and options accordingly.

 

===

Admin Edit:

It would be useful if you could disable the default sorting of the groups as well.

Duplicated
Last Updated: 25 Oct 2022 22:32 by ADMIN
Created by: Rick
Comments: 1
Category: ComboBox
Type: Feature Request
6

We are needing a way to display a hierarchy inside the ComboBox.  I don't see any examples on this particular feature, I had found a similar request, but not identical.

Our use case:

We have administrators that manage multiple tenants within our system.  The tenants are part of a hierarchy, the user needs to be able to select a tenant or tenant parent.

I will use hotels as an example:

-Chain 1

--Brand 1

---Property 1

---Property 2

--Brand 2

---Property 3

Our current system that we are migrating controls from has this feature, so I would like to stick as close to this functionality as possible, however; if it is not an option, what control would you suggest as an alternative.

See example (sorry for the redactions)

The core concept is providing a user a choice as part of a form, but layout needs to be organized so that a user can easily navigate.  Top level names are unique, all other names can duplicate since they may share similar naming conventions across different organizations.

An option that may work as an alternative, is invoking a dialog popup and within it having a tree list of the information I need.  I think it could work, but it would certainly break the flow of the form.

Duplicated
Last Updated: 07 Jun 2024 18:57 by Jonathan
Created by: Alexander
Comments: 6
Category: ComboBox
Type: Bug Report
5

When the option "AllowCustom" is enabled for a TelerikComboBox and the user types something above a certain speed, typed characters are lost. Here is a GIF showing the problem on the page https://demos.telerik.com/blazor-ui/combobox/custom-values â€“ I typed "123456", but end up with "1246" instead. In between the input field is showing some weird glitching.

Is there a way to have the TelerikComboBox behave normally, as it apparently did in versions prior to 4.3.0? We noticed this behavior only some time after upgrading from version 4.0.1, where everything still works properly.

Unplanned
Last Updated: 30 Jun 2022 01:30 by Chris

I would like to use an event that fires only when the user clicks on an item from the dropdown. 

=====

ADMIT EDIT:

Here is a possible way to achieve this now:

<TelerikComboBox @bind-Value=@SelectedValue
                 Data="@ComboBoxData"
                 ValueField="ProductId"
                 TextField="ProductName">
    <ItemTemplate>
        @{
            var currentItem = context as Product;

            <div onclick="@(() => OnClickHandler(currentItem))" style="width:100%">
                @currentItem.ProductName
            </div>
        }
    </ItemTemplate>
</TelerikComboBox>

@code {
    private void OnClickHandler(Product item)
    {
        //the application logic here
    }

    public IEnumerable<Product> ComboBoxData { get; set; }
    public int SelectedValue { get; set; } = 2;

    protected override void OnInitialized()
    {
        List<Product> products = new List<Product>();
        for (int i = 1; i < 10; i++)
        {
            products.Add(new Product()
                {
                    ProductId = i,
                    ProductName = $"Product {i}",
                    UnitPrice = (decimal)(i * 3.14)
                });
        }

        ComboBoxData = products;
        base.OnInitialized();
    }

    public class Product
    {
        public int ProductId { get; set; }
        public string ProductName { get; set; }
        public decimal UnitPrice { get; set; }
    }
}

Completed
Last Updated: 28 Jan 2020 11:26 by ADMIN
Release 2.7.0
Created by: Sylvain
Comments: 3
Category: ComboBox
Type: Bug Report
4

Hi,

 

If I enter some characters in the ComboBox to filter it, the characters that I enter aren't shown and the filtering is not correct. Indeed, if I enter "ALU" (some of my data start with "ALU", no data appears.

Completed
Last Updated: 24 Feb 2021 12:58 by ADMIN
Release 2.23.0
Created by: Eugene
Comments: 0
Category: ComboBox
Type: Bug Report
4
Selection should not reset value on data change
Completed
Last Updated: 31 May 2022 06:54 by ADMIN
Release 3.4.0

In my data, I have multiple identical values for the TextField of the ComboBox. When the user selects one of them and focuses away from the component the selected value changes to the first instance of the items with the same TextFields, although they have different ValueFields.

Reproduction:

<TelerikComboBox Data="@myDdlData" 
                 TextField="MyTextField" 
                 ValueField="MyValueField" 
                 Value="selectedValue" 
                 ValueChanged="@((int? id) => ValueChangedHandler(id))" 
                 FilterOperator="StringFilterOperator.Contains"
                 Filterable="true">
</TelerikComboBox>

@code {
    private List<MyDdlModel> myDdlData { get; set; }

    private void ValueChangedHandler(int? id)
    {
        selectedValue = id;
    }

    public class MyDdlModel
    {
        public int? MyValueField { get; set; }
        public string MyTextField { get; set; }
    }

    int? selectedValue { get; set; }

    protected override void OnInitialized()
    {
        myDdlData = new List<MyDdlModel>()
        {
            new MyDdlModel()
            {
                MyValueField = 1,
                MyTextField = "John Smith"
            },
            new MyDdlModel()
            {
                MyValueField = 2,
                MyTextField = "John Smith"
            },
            new MyDdlModel()
            {
                MyValueField = 3,
                MyTextField = "John Smith"
            },
            new MyDdlModel()
            {
                MyValueField = 4,
                MyTextField = "Alice Jones"
            },
            new MyDdlModel()
            {
                MyValueField = 5,
                MyTextField = "Alice Jones"
            },
        };
    }
}

Completed
Last Updated: 08 Apr 2021 16:18 by ADMIN
Release 2.24.0

Replication code:

 

@SelectedValue
<br />
<TelerikComboBox Data="@DdoData"
                 OnRead="@OnReadHandler"
                 Filterable="true"
                 ValueField="RecId"
                 TextField="DdoTitle"
                 Placeholder="Find what you seek by typing"
                 @bind-Value="@SelectedValue">
</TelerikComboBox>

@code{
    public int SelectedValue { get; set; } = 4;
    List<ddo> DdoData { get; set; }
    public string ddoCbType { get; set; } = "Default";
    int InitialId { get; set; }
    string currentText { get; set; } = "";

    protected override async Task OnInitializedAsync()
    {
        await ReadDdoData(ddoCbType, "");
        if (SelectedValue > 0)
        {
            InitialId = (int)SelectedValue;
            await ReadDdoData(ddoCbType, currentText);
        }
    }

    async Task OnReadHandler(ComboBoxReadEventArgs args)
    {
        if (args.Request.Filters.Count > 0)
        {
            Telerik.DataSource.FilterDescriptor filter = args.Request.Filters[0] as Telerik.DataSource.FilterDescriptor;
            currentText = filter.Value.ToString();
            await ReadDdoData(ddoCbType, currentText);
        }
        else
        {
            currentText = "";
            await ReadDdoData(ddoCbType, "");
        }
    }

    private async Task ReadDdoData(string ddoCbType, string currentText)
    {
        await Task.Delay(100);

        DdoData = new List<ddo>()
        {
                new ddo(){ RecId = 1, DdoTitle = "one"},
                new ddo(){ RecId = 2, DdoTitle = "two"},
                new ddo(){ RecId = 3, DdoTitle = "Three"},
                new ddo(){ RecId = 4, DdoTitle = "Four"},
                new ddo(){ RecId = 5, DdoTitle = "Five"}
            };

        //this does not help
        await InvokeAsync(StateHasChanged);
    }

    public class ddo
    {
        public int RecId { get; set; }
        public string DdoTitle { get; set; }
    }
}



Completed
Last Updated: 11 Aug 2023 09:17 by ADMIN
Release 4.5.0 (08/30/2023) (R3 PI2)

When the height of the popup is set to 'auto' and it opens upwards, the resizing process causes it to be incorrectly positioned.

# Reproduction:

1. Open this REPL - https://blazorrepl.telerik.com/mHuoPRFk52ienlUt52
2. Shrink the browser so that the ComboBox remains at the bottom of the window: 


3. Type "item 2" in the ComboBox

Completed
Last Updated: 29 Jan 2020 10:22 by ADMIN
Release 2.6.0

When i search for something by typing in combobox, i want to be able to use the keyboard to make my selection

Exable below, if i press b, I want to be able to either select baseboll by pressing enter, or make another selection by using arrow keys and then enter. 

 

 

 

Unplanned
Last Updated: 06 Nov 2023 16:56 by Miroslav

Reproduction: https://blazorrepl.telerik.com/cHbFYUFq53Ext4Yt24.

Steps to reproduce:

  1. Open popup.
  2. Use the keyboard to navigate to the first item.
  3. Type "1", so the input value is "item11" (a value that matches an item from the list) -> ValueChanged is not fired.
  4. Type "1" again, so the input value is "item111" (this is a custom value not present in the list) -> ValueChanged is fired.
  5. Delete the last "1", so the input value is again "item11"(a value that matches an item from the list) -> ValueChanged is not fired.
Unplanned
Last Updated: 09 Oct 2020 10:36 by ADMIN
Created by: Marco
Comments: 0
Category: ComboBox
Type: Feature Request
3

Would be fine if when you click on a filterable combobox the whole text in it will be selected, so you can click and start digit new text filter without delete the old text before.

---

ADMIN EDIT

This should probably be behind a flag to keep the original behavior.

At the moment, you can achieve it with a bit of JS to focus and select all the text:

 

    <script>
        function selectAllText(parentElem) {
            let input = parentElem.querySelector(".k-input");
            if (input && input.focus) {
                input.select();
            }
        }
    </script>

 

Which you can call with the approach from this article:

 

@inject IJSRuntime _js

@SelectedValue
<br />

<span @onfocusin="@SelectAllText" @ref="@spanRef">
    <TelerikComboBox Data="@Data"
                     Filterable="true" FilterOperator="@StringFilterOperator.Contains"
                     Placeholder="Find product by typing part of its name"
                     @bind-Value="@SelectedValue" 
                     TextField="ProductName" ValueField="ProductName" AllowCustom="true">
    </TelerikComboBox>
</span>

@code {
    ElementReference spanRef { get; set; }
    async Task SelectAllText()
    {
        await _js.InvokeVoidAsync("selectAllText", spanRef);
    }

    public List<Product> Data { get; set; }
    public string SelectedValue { get; set; }

    protected override void OnInitialized()
    {
        List<Product> products = new List<Product>();
        for (int i = 0; i < 20; i++)
        {
            products.Add(new Product()
            {
                ProductId = i,
                ProductName = $"Product {i}"
            });
        }

        Data = products;
        base.OnInitialized();
    }

    public class Product
    {
        public int ProductId { get; set; }
        public string ProductName { get; set; }
    }
}

 

1 2 3