Declined
Last Updated: 03 Oct 2024 08:59 by ADMIN
Roberto
Created on: 03 Oct 2024 08:27
Category: ComboBox
Type: Feature Request
3
Set the selected item of a combobox using OnRead programmatically without refreshing the data

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);
    }
}
2 comments
ADMIN
Dimo
Posted on: 03 Oct 2024 08:59

Hello Roberto and everyone,

This feature request is a next step of a support ticket. We already communicated that the proposed enhancement is not consistent with:

  • the current data binding mechanisms
  • our API vision
  • Blazor practices for using parameters to set a component's Value

That's why I am setting the status to Declined. The purpose of this feature request is to measure possible customer demand.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.