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

Postback on each key press

1 Answer 67 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Duncan
Top achievements
Rank 2
Duncan asked on 22 Feb 2012, 06:22 PM
I have a combo box that allows custom text. Is there a way for the combo box to perform a postback each time the text in the combo box is updated, added to or removed from? It seems as though current i have to click away from the combo box or hit enter for a postback to occur.

Also, if the above is possible, is there a way to make it NOT postback if there are items available in the list?

Thank,
Duncan

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 27 Feb 2012, 03:18 PM
Hello Duncan,

The desired functionality is not supported from the RadComboBox. A post-back is performed only when the control looses focus. In case you want to prevent a post-back to appear if there are items in the control you should subscribe to the client-side OnClientTextChange event and cancel it as shown below:
function OnClientTextChange(sender, eventArgs) {
 
    if (sender.get_items().get_count() > 0) {
 
        eventArgs.set_cancel(true);
    }
}


Greetings,
Dimitar Terziev
the Telerik team
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 their blog feed now.
Tags
ComboBox
Asked by
Duncan
Top achievements
Rank 2
Answers by
Dimitar Terziev
Telerik team
Share this question
or