This is a migrated thread and some comments may be shown as answers.

Clear RadComboBox selection from IE

1 Answer 123 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 02 Jun 2016, 07:14 PM

We had the following problems when a RadDropDownList has properties set to:

<telerik:RadComboBox  runat="server" ID="cmbStation" Width="100%" AutoPostBack="true" CausesValidation="false" EmptyMessage="Choose one" MarkFirstMatch="true" DataSource='<%# Stations %>' />

 

Once we clicked "clear" the content of the RadComboBox with the "X" button in IE or clear manually, no postback was raised from the control.

Instead have a "telerik" way, we just set the client event "OnClientDropDownClosing" the following javascript fonction:

function CheckIfCleared(sender, eventArgs) {
    if (sender._value == "" && sender._filterText == "") {
        sender.clearSelection();
        sender._applyEmptyMessage();
        __doPostBack(sender._uniqueId, 'SelectedIndexChanged');
    }
    return true;
}

Is there a "Telerik" way, for current or next release, embedded in this control to do it ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Nencho
Telerik team
answered on 07 Jun 2016, 08:09 AM
Hello Louis,

The referenced X button is automatically added by the Internet Explorer for all inputs on the page that has any value in them. This button is not supported with our controls, which is why, we suggest to hide it and avoid its usage for clearance of the selection of the ComboBox.

You can use the following css style rules in order to hide the Clear Button in Internet Explorer:

<style type="text/css">
        .rcbInput::-ms-clear {
            display: none;
        }
    </style>

Regards,
Nencho
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
DropDownList
Asked by
Louis
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or