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

Rad Combobox on ClientBlur Event Not Setting Custom Text

1 Answer 78 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Haris
Top achievements
Rank 1
Haris asked on 22 Jun 2013, 10:05 AM
Rad Combobox on ClientBlur Event setting Custom Text fine when we are going to press TAB  key but we are getting issue when we are selecting item from Rad Combo Box manually using Mouse.On clicking suppose i have text :

ILS - APPLE

I have called onclientblur event which is splitting text into ILS and Apple and I am showing ILS.

On TAB it is working fine(Showing ILS) , But problem is getting issue (showing ILS-APPLE) on selecting the item clicking by mouse and then clicking out side it is showing ILS - APPLE instead of ILS.


Thanks in Advance

Regards,
Haris

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 27 Jun 2013, 06:53 AM
Hello Haris,

I would like to clarify that we are not aware of such issue with our RadComboBox control and I am afraid that I was not able to replicate that problem locally. Here you may watch a very similar scenario behavior and it works as expected. Below you may find the source code of the tested project for reference. Please explain what exactly is different in your project and clarify what version of the RadControls you are using.
//markup code
<telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="Select an item please..." OnClientBlur="ClientBlur">
    <Items>
        <telerik:RadComboBoxItem Text="Item 1" />
        <telerik:RadComboBoxItem Text="Item 2" />
        <telerik:RadComboBoxItem Text="ILS - APPLE" />
    </Items>
</telerik:RadComboBox>
//JavaScript
function ClientBlur(sender, args) {
    var combo = sender;
    var selectedText = combo.get_text();
    if (selectedText == "ILS - APPLE") {
        var dashChar = selectedText.indexOf("-");
        var newText = selectedText.substr(0, dashChar - 1);
        combo.set_text(newText);
    }
    else {
        combo.set_text("ILIS");
    }
}

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
DropDownList
Asked by
Haris
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or