Mark Wells
Posted
on Mar 26, 2010
(permalink)
Hi,
I need to be able to stop the combobox from posting back when it loses focus. I am using it as a load on demand box that returns search results. When the user chooses a selection, I handle the SelectedIndexChanged event and this is fine. The problem happens when they do not choose a result and decide to click on a button to do something. What happens is that the combobox loses focus and does a postback which negates the button click event. Consequently, the user must click on the button again to re-instate
the button click event.
I tried to handle the OnClientBlur event and return false but that doesn't stop the postback.
Is there anyway I can do this?
Thanks,
Mark
Simon
Simon
Posted
on Mar 29, 2010
(permalink)
Hi Mark Wells,
Before providing you with the workaround I tried recreating the issue without success.
Can you please see the attached page and let me know if I am missing something?
All the best,
Simon
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items.
Mark Wells
Posted
on Mar 29, 2010
(permalink)
Hi Simon,
I was able to re-create the problem with the code that you supplied. The postback happens if the user typed into the combobox but did not choose one of the supplied options. The user then clicks outside the box so that it loses focus and it does the postback.
I am using a different version than you so I am providing you code with the changes that I made.
Answer
Simon
Simon
Posted
on Mar 30, 2010
(permalink)
Hi Mark Wells,
Thank you for the clarification.
This happens because the classic RadComboBox postbacks if its Text is changed as well.
You can avoid this by handling the client-side Blur event in this way:
Regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items.
Mark Wells
Posted
on Mar 30, 2010
(permalink)
Thank you Simon. The onBlur function that you provided solves my problem.
Sid
Posted
on Apr 1, 2011
(permalink)
Hi,
I tried suggested code, but I got following error, Object doesn't support this property or method.
Regards Sid
Simon
Simon
Posted
on Apr 6, 2011
(permalink)
Hi Sid,
You are most probably using the ASP.NET AJAX version of RadComboBox, which has a different API. You can use the following code instead:
I hope this helps.
Kind regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items