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.
RadDropDownList has an attribute "DropdownWidth" that controls the width of the LIST when it drops down. If you set the width to a specific number of pixels (say 200px) then there is no issue. But if you set it to "100%" then I would have expected it to be 100% of the owner controls width. But this is not the case, and it becomes very evident when the RadDropDownList is used with a template column of a RadGrid. In a RadGrid template column, this setting causes the LIST width to expand all the way to the right edge of the screen. This seems to me to be a bug, as it makes no sense to behave this way. You can see this behavior in the screenshot I have attached. It becomes more evident that this was not the intended functionality (and must be a bug) when you substitute the control with a RadComboBox, having exactly the same attributes. This will use the combo's default settings and show a dropdown list. With the RadCombBox the LIST does not expand to the far right of the screen, it behaves as expected, having 100% of the combobox width. I would expect both controls to work identically with their LISTS when setting the "DropdownWidth" attribute to "100%".
Workaround: Place the following script below the ScriptManager. var $T = Telerik.Web.UI; var $ = $ || $telerik.$ var _toggleActiveDescendantAttributes_old = $T.RadDropDownList._toggleActiveDescendantAttributes; $T.RadDropDownList._toggleActiveDescendantAttributes = function (element, id, value) { if ($("#" + id + "_selected_item").length == 1) { $("#" + id + "_selected_item").removeAttr('id') } _toggleActiveDescendantAttributes_old.call(this, element, id, value); }
add min-dropdownheight and max-dropdownheight to raddropdownlist (to let it "grow" until a max-height