Unplanned
Last Updated: 29 Mar 2022 19:19 by ADMIN
Svetoslav
Created on: 01 Jul 2020 08:15
Category: DropDownList
Type: Feature Request
12
Add support for disabled items

Hello everyone,

We have opened this Feature Request to gather your insights on the addition of disabled items for the DropDownList.

As a workaround, for the time being, you could use the following code snippet. It would prevent the user from clicking on the item with the mouse, but navigating with the keyboard and selecting it would still work.

<style>
    .disabled-item {
        color: #D3D3D3;
        width:100%;
    }

    /* remove default padding so the user can't click the underlying element outside the template
        Note: this will also affect other dropdowns on the page
    */
    .ddl-item {
        padding: 4px 8px;
    }

    .k-popup ul.k-list li.k-item {
        padding: 0;
    }
</style>

@TheValue
<br />

<TelerikDropDownList Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="@TheValue">
    <ItemTemplate>
        @{
            MyDdlModel item = context as MyDdlModel;
            <div @onclick:preventDefault="@item.IsDisabled" 
                 @onclick:stopPropagation="@item.IsDisabled"
                 class="@( item.IsDisabled ? "disabled-item ddl-item" : "ddl-item" )">
                    @item.MyTextField
            </div>
        }
    </ItemTemplate>
</TelerikDropDownList>


@code {
    int TheValue { get; set; } = 2;

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

    IEnumerable<MyDdlModel> myDdlData = Enumerable.Range(1, 20).Select(x => new MyDdlModel
    {
        MyTextField = "item " + x,
        MyValueField = x,
        IsDisabled = x % 3 == 0
    });
}

4 comments
ADMIN
Marin Bratanov
Posted on: 29 Mar 2022 19:19

Hi Andy,

 

I recommend you open a private support ticket where we can discuss your options and feedback.

 

Regards,
Marin Bratanov
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.

Andrew
Posted on: 28 Mar 2022 16:47

Hi Marin,

I appreciate that, here's the rub from my perspective. I've recommended to a client that we go with Blazor and we stick with Telerik as you say it's had three years of investment.

Yet things like ghosting tool tips and this makes for a very poor user experience, and some things cannot be worked around easily (already had to find workarounds for other issues).

My ask is that these things are prioritised over and above adding new features, great that there are 100 components but not if the basics are missing. More than happy to have a conversation with a product manager about this. Reality is that if these things don't get addressed there are more and more components in the open source community that will meet these needs.

Best,

Andy

ADMIN
Marin Bratanov
Posted on: 28 Mar 2022 16:36

Hi Andrew,

The UI for Blazor suite is a brand new set of native components we are building from the ground up to target the Blazor framework specifically. Thus, since they are not wrappers over jQuery widgets, implementing all the features you have seen in older suites will take some time - even though we are working very actively. In about 3 years we are already at about 100 components that cover the core scenarios as well as some of the advanced ones. At the same time, suites like WebForms or jQuery are >10 years old, so it will be natural that they have a head start.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Andrew
Posted on: 27 Mar 2022 12:28
Sure this functionality is available in Razor Pages - so am wondering why it's not implemented. Is there a reason why the basics are being overlooked?