Unplanned
Last Updated: 15 Nov 2024 13:24 by ADMIN
Scheduled for 2024 Q4 (Nov)

I am using ComboBox and I want to be able to filter by two model properties. To achieve this I have implemented custom filtering through the OnRead event. Additionally, I am ordering the data to first match the results from the one property, which also is used for the TextField, and after that to match the results from the other property. However, when the results are only from the match of the second property, there is no focus.

Here is a REPL example https://blazorrepl.telerik.com/wyaMQhEN108axXJ036 

Steps to reproduce the issue:

Type "a": "Value test - ano" has the focus (the first option in the list)

Type "an": "Value test - ano" receives the focus (the first option in the list)

Type "ano": "Value test - ano" receives the focus (the first option in the list)

Type "anot": no item has focus despite the results being only "Another Value - val"

Unplanned
Last Updated: 29 Oct 2024 11:16 by ADMIN
Created by: Ricardo
Comments: 2
Category: ComboBox
Type: Feature Request
1

I want to access runtime the value by which the user filters. 

===ADMIN EDIT===

Use the OnRead event handler to access the filter value:

@using Telerik.DataSource
@using Telerik.DataSource.Extensions

<TelerikComboBox OnRead="@OnComboBoxRead"
                 TItem="@ListItem"
                 TValue="@int"
                 @bind-Value="@SelectedValue"
                 TextField="@nameof(ListItem.Text)"
                 ValueField="@nameof(ListItem.Id)"
                 Filterable="true"
                 FilterOperator="@StringFilterOperator.Contains"
                 Width="300px">
    <ItemTemplate>
        @HighlightResult(context.Text)
    </ItemTemplate>
</TelerikComboBox>

<style>
    .k-list-item:has(u) {
        gap: 0;
    }
</style>

@code {
    private List<ListItem> ListItems { get; set; } = new();

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

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

    private async Task OnComboBoxRead(ComboBoxReadEventArgs args)
    {
        ComboBoxFilterValue = args.Request.Filters.Cast<FilterDescriptor>().FirstOrDefault()?.Value.ToString() ?? string.Empty;

        DataSourceResult result = await ListItems.ToDataSourceResultAsync(args.Request);

        args.Data = result.Data;
        args.Total = result.Total;
    }

    public MarkupString HighlightResult(string text)
    {
        var result = string.IsNullOrWhiteSpace(ComboBoxFilterValue)
            ? text
            : text.Replace(ComboBoxFilterValue, "<u>" + ComboBoxFilterValue + "</u>", StringComparison.OrdinalIgnoreCase);

        return new MarkupString(result);
    }

    protected override void OnInitialized()
    {
        ListItems = new List<ListItem>() {
            new ListItem(1, "Basketball"),
            new ListItem(2, "Golf"),
            new ListItem(3, "Baseball"),
            new ListItem(4, "Table Tennis"),
            new ListItem(5, "Volleyball"),
            new ListItem(6, "Football"),
            new ListItem(7, "Boxing"),
            new ListItem(8, "Badminton"),
            new ListItem(9, "Cycling"),
            new ListItem(10, "Gymnastics"),
            new ListItem(11, "Swimming"),
            new ListItem(12, "Wrestling"),
            new ListItem(13, "Snooker"),
            new ListItem(14, "Skiing"),
            new ListItem(15, "Handball"),
            };

        base.OnInitialized();
    }

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

        public ListItem(int id, string text)
        {
            Id = id;
            Text = text;
        }
    }
}

Unplanned
Last Updated: 24 Oct 2024 12:30 by Mattia

The ComboBox and MultiComboBox replace the current filter value with the component value during virtual scrolling.

The issue is similar to MultiColumnComboBox and ComboBox remove filtering value after virtual scrolling , but the other issue occurred when there was no current value.

To reproduce:

  1. Go to https://demos.telerik.com/blazor-ui/combobox/virtualization
  2. Select item Changde
  3. Filter by "Ch"
  4. Scroll down

Ch will be replaced by Changde.

If custom values are not required, a possible workaround is to use a filterable DropDownList with virtualization.

For the MultiColumnComboBox, the component can use a RowTemplate to simulate multiple columns in the dropdown. You can see a REPL example here.

Unplanned
Last Updated: 04 Oct 2024 15:28 by ADMIN
Created by: Harrison
Comments: 3
Category: ComboBox
Type: Feature Request
10

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.

Unplanned
Last Updated: 03 Oct 2024 09:22 by Roberto
Created by: Roberto
Comments: 1
Category: ComboBox
Type: Feature Request
6

When using the OnRead event of the ComboBox there is no way to retrieve the selectedItem because the list of items that is populated is internal.

There are 2 workaround but they are not ideal:

- Saving the list of items returned by the OnRead event into a parallel list and then retrieve the selectedItem from it -> the problem is that there will be 2 identical lists in memory and, if scaled, might cause problems:

CachedSitesList = result.Items;

args.Data = result.Items;
args.Total = (int)result.TotalCount;

- Retrieving the selectedItem by calling the DB using the Id of the item -> the problem is that it's one more request to add to the DB and the performance is going to decrease if scaled, also it seems useless as the item is already present in memory.

We suggest adding a function to return the selectedItem to improve performance and scalability of the component.

Declined
Last Updated: 03 Oct 2024 08:59 by ADMIN

Please add a way to add, if it is missing in the item list, and set the selected item of a combobox programmatically. This will spare the need to call the remote source and have duplicate data.

Example: if you choose a city from a combobox and the city has all the information about the province, the province combobox should populate with the correct data without needing to call the remote source.

An Implementation of this could be:

public void SetSelectedItem(TItem item)
{
    if (item == null)
    {
        ClearButtonClick();
    }
    else
    {
        ListDataItem clonedItem = CreateDataItem(item.Clone());

        var dataItemToSelect = DataItems.FirstOrDefault(x => x.Value.Equals(clonedItem.Value));
        if (dataItemToSelect == null)
        {
            dataItemToSelect = clonedItem;
            AddCustomValue(dataItemToSelect.Text, dataItemToSelect.Value, dataItemToSelect.DataItem);
        }

        SelectItem(dataItemToSelect);
    }
}
Unplanned
Last Updated: 19 Jul 2024 08:23 by Liviu Ciocoiu

The problematic behavior appears in this specific scenario:

  • AllowCustom="true".
  • The input partially matches an item in the list.
  • The user presses Enter

In this case, the custom typed value is lost and the component value is the first item in the list matching the input. Thus, the user cannot set their desired custom value.

Reproduction with steps listed inside: https://blazorrepl.telerik.com/GokVlXEW12KGZ36F15.

===

ADMIN EDIT

===

A possible option for the time being:

  • Enable filtering.
  • Use the OnRead event to get the input value from the filter descriptors and save it.
  • In the OnChange event that is triggered on Enter press, set the saved input value to the component.

Here is a basic sample: https://blazorrepl.telerik.com/wourlNOC51FRcNAX54.

Unplanned
Last Updated: 02 Jul 2024 05:50 by ADMIN

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.

===

TELERIK EDIT: A possible workaround is to obtain the typed string in OnChange and check if it is matching an item in the datasource:

https://blazorrepl.telerik.com/QyPEQXkV25A7VFyf50

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.

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

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: 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;
    }
}

 

Unplanned
Last Updated: 14 Feb 2024 13:13 by Bably

An open ComboBox will not close when the user tabs out of it when the ComboBox is the last component on the page. Here is a test example: Creating Blazor ComboBox

If there is another component after the ComboBo, then tabbing out works correctly.

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: 12 Dec 2023 12:20 by ADMIN
Release 5.1.0 (31 Jan 2024) (R1 2024)

Hi Telerik Support.

I am using TelerikComboBox with Virtualization and enabled Filtering.  If I filter for a text and then scroll down, the filter text gets cleared. I am using OnRead event to populate the combo box. But the same issue is seen with local data population in the below sample code.

https://demos.telerik.com/blazor-ui/combobox/virtualization

I need to show the user the text they have entered even when they scroll down to the next page. Is there a solution for this? 

Regards

Bably

Completed
Last Updated: 31 Oct 2023 12:13 by ADMIN
Release 5.0.0 (15 Nov 2023) (R1 PI1)
When I enable the ReadOnly parameter, I can still tab into the input of the ComboBox and change the component value with the arrow keys.
Completed
Last Updated: 31 Oct 2023 07:36 by ADMIN
Release 5.0.0 (15 Nov 2023) (R1 PI1)
The extended DDL is reopened as soon as it is clicked to close it. The problem can be reproduced on Telerik's demo page. Blazor UI version 3.6.1 and 4.0.0 on Safari 15.6.1 and 16: https://docs.telerik.com/blazor-ui/components/combobox/overview#creating-combobox
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

Unplanned
Last Updated: 22 Jun 2023 09:23 by Ben

I'd like to report a bug with the Telerik combo box opening animation.

The problem can be reproduced on your page https://demos.telerik.com/blazor-ui/combobox/templates

Reproduction steps

1. Open page https://demos.telerik.com/blazor-ui/combobox/templates
2. Change the window to restored mode
3. Open the Product combo box and observe that the popup animation works as expected
4. Resize the window slightly vertically
5. Open the Product combo box
6. Observe that the combo box popup animation starts in the wrong place

This issue is 100% reproduceable every time and also can be reproduce if the popup is opened and the window is maximized.

Please see the attached video from about 15 to 25 seconds. Note that I reproduce the issue in the video a couple of times however due to the quality of it you can only see the incorrect animation between 15 to 25 seconds.

I hope the information helps.

Unplanned
Last Updated: 19 Jun 2023 08:02 by Peter
When the validation summary is placed and triggered above the Combobox component, it causes the combo input to move down hiding it behind the popup.
Unplanned
Last Updated: 07 Jun 2023 18:29 by Dialog
Created by: Dialog
Comments: 0
Category: ComboBox
Type: Feature Request
2

The tablet that I am using is slightly wider than the medium breakpoints set in AdaptiveMode.Auto. However, I still want to show the action sheet. I'd like to be able to configure the breakpoints which are currently hard-coded.

===

ADMIN EDIT

===

The request is opened for ComboBox but it also targets other selects and pickers that have AdaptiveMode feature. For example, DropDownList, MultiSelect, DatePicker and more.

1 2 3