When using the RadAutoCompleteBox, is there a way to clear the text of a previous selection in the text input area? I have used the clear() method in both the RadAutoCompleteBox object and the AutoCompleteBoxEntryCollection object, which does indeed remove all the entries from the collection. But there seems to be no way to get to the displayed selection in the text area and clear it also. Thank you for any insight into this issue.
5 Answers, 1 is accepted
0
![](/forums/images/avatarimages/4fdd2ccd-e7c9-4bf9-b19f-96bcfcf0bd7btelerik.jpg)
Princy
Top achievements
Rank 2
answered on 18 Oct 2012, 05:40 AM
Hi Bill,
Try the following code to achieve your scenario.
C#:
Thanks,
Princy.
Try the following code to achieve your scenario.
C#:
protected
void
RadButton1_Click(
object
sender, EventArgs e)
{
RadAutoCompleteBox1.Entries.Clear();
}
Thanks,
Princy.
0
Hi Bill,
Can you paste here the RadAutoCompleteBox markup that you use?
Regards,
Kalina
the Telerik team
Can you paste here the RadAutoCompleteBox markup that you use?
Regards,
Kalina
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.
0
![](/forums/images/avatarimages/default.gif)
Bill
Top achievements
Rank 1
answered on 18 Oct 2012, 04:44 PM
The suggestion works for me. Thank you.
However I am confronted with another problem now. Is there a way to block any typing/input in the text area after a selection is made?
Is there some king of OnKeyPress event for this text box area?
However I am confronted with another problem now. Is there a way to block any typing/input in the text area after a selection is made?
Is there some king of OnKeyPress event for this text box area?
0
![](/forums/images/avatarimages/4fdd2ccd-e7c9-4bf9-b19f-96bcfcf0bd7btelerik.jpg)
Princy
Top achievements
Rank 2
answered on 19 Oct 2012, 05:30 AM
Hi Bill,
You can disable the input element in OnClientEntryAdded event of RadAutoCompleteBox as follows.
JS:
Thanks,
Princy.
You can disable the input element in OnClientEntryAdded event of RadAutoCompleteBox as follows.
JS:
<script type=
"text/javascript"
>
function
OnClientEntryAdded(sender, args)
{
sender.get_inputElement().disabled =
true
;
}
</script>
Thanks,
Princy.
0
![](/forums/images/avatarimages/default.gif)
Bill
Top achievements
Rank 1
answered on 19 Oct 2012, 01:08 PM
Thanks for your help. Everything is working now with my RadAutoCompleteBox implementation.. On to the next task.
Bill
Bill