Unplanned
Last Updated: 30 Aug 2023 09:41 by ADMIN
mathieu
Created on: 23 Aug 2023 14:03
Category: DropDownList
Type: Bug Report
1
Wrong selecteditem when one item's visibility is set to false

Hi Telerik team,

Using DropDownList with 4 items, setting visibility of the third one to false (either directly in apsx definition or setting it at page load event), display is OK, but when selecting the fourth and submitting the changes, server see the third one selected.

Attached is a project reproducing ths issue.

1 comment
ADMIN
Rumen
Posted on: 30 Aug 2023 09:41

Hi Mathieu,

Thank you for reporting this issue! I verified the bug report and set its status to Unplanned.

Until the problem gets fixed, you can use one of the following solutions:

  • Hide the ComboBoxItem with a CSS style:

                <style>
                    .hiddenItem  { display: none; }
                </style>
                <telerik:RadDropDownList runat="server" ID="ddl_example" Width="95%">
                    <Items>
                        <telerik:DropDownListItem Text="-" Value="-1" />
                        <telerik:DropDownListItem Text="Item 1" Value="1" />
                        <telerik:DropDownListItem Text="Item 2" Value="2" />
                        <telerik:DropDownListItem CssClass="hiddenItem" Text="Item 3" Value="3"/>
                        <telerik:DropDownListItem Text="Item 4" Value="4" />
                    </Items>
                </telerik:RadDropDownList>


  • Replace the DropDownList with RadComboBox: 

                <telerik:RadComboBox runat="server" ID="ddl_example" Width="95%">
                    <Items>
                        <telerik:RadComboBoxItem Text="-" Value="-1" />
                        <telerik:RadComboBoxItem Text="Item 1" Value="1" />
                        <telerik:RadComboBoxItem Text="Item 2" Value="2" />
                        <telerik:RadComboBoxItem Visible="false" Text="Item 3" Value="3"/>
                        <telerik:RadComboBoxItem Text="Item 4" Value="4" />
                    </Items>
                </telerik:RadComboBox>

As a small token of gratitude for reporting the issue, I updated your Telerik points.

Regards,
Rumen
Progress Telerik

Heads up! Telerik UI for ASP.NET AJAX versions for .NET 3.5 and 4.0 are retired. Progress will continue shipping assemblies compatible with .NET 4.5 and later. See whether this affects your apps in this article.