9 Answers, 1 is accepted
HI Yan,
I tested the AutoCompleteBox with AllowCustomEntry set to False, but its content is not cleared at my end after I press Enter (or click into the control). Can you, please provide some more details on the exact scenario leading to the problem?
- Can you verify that there are not any JavaScript errors thrown on the page?
- Can you ensure that the control is used in AutoID mode and the static client IDs are not supported? (make sure to remove)
If none of the above is the case, please, send me a small page where I can reproduce the problem and examine the exact setup leading to it.
Regards,
Vessy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Yan,
I tested the control with not matching words, but it is not being cleared after pressing enter. You can see a video from my test here:
<telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="RadAutoCompleteBox1"
EmptyMessage="Please type here" AllowCustomEntry="false"
DataSourceID="SqlDataSource1" DataTextField="FirstName"
InputType="Text" Width="350" DropDownWidth="150px">
</telerik:RadAutoCompleteBox>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [FirstName], [LastName], [EmployeeID] FROM [Employees]"></asp:SqlDataSource>
<script>
Regards,
Vessy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
You can see it happening here.
This is my RadAutoCompleteBox setup:
<
telerik:RadAutoCompleteBox
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadAutoCompleteBox1"
ClientID
=
"RadAutoCompleteBox1"
autopostback
=
"true"
DataSourceID
=
"SqlDataSource1"
DataTextField
=
"xxxxx"
DataValueField
=
"yyyyy"
InputType
=
"Token"
Width
=
"100%"
Visible
=
"true"
AllowCustomEntry
=
"false"
DropDownWidth
=
"300px"
>
</
telerik:RadAutoCompleteBox
>
Hi Yan,
The behavior faced in the linked URl is expected due to the enabled AutoPostBack and the disabled custom text of the control. When a custom text is entered in the controls it does not selects an item from the list, but rather creates a new on with the entered text. If the AllowCustomEntry property is disabled, the control does not create such an item, thus there is no any selected item when the control is blurred (and respectively, a Postback is triggered) leading to the cleared input.
Setting the AutoCompleteBox's AllowCustomEntry="true" and/or AutoPostback="False" is the way to keep the inserted non-matching words:
<telerik:RadAutoCompleteBox RenderMode="Lightweight" ID="RadAutoCompleteBox1" runat="server" InputType="Text" AllowCustomEntry="true" Font-Size="Small" >
...
</telerik:RadAutoCompleteBox>
Regards,
Vessy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi,
You are welcome, Yan! I just have to clarify that this is not a limitation of the control, but is its designed behavior when the AllowCustomEntry is disabled and a Postback is performed. There are two possible workarounds:
- enable the AllowCustomEntry option
- disable the AutoPostback of the control
Regards,
Vessy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.