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

AutoCompleteBox Validation Wrapping

2 Answers 141 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Germán
Top achievements
Rank 1
Germán asked on 27 May 2014, 01:15 PM
Dear Telerik,

I have the following AutoCompleteBox:

<td style="width: 150px; white-space:nowrap">
<telerik:RadAutoCompleteBox ID="MachineWORadAutoCompleteBox" runat="server"
TextSettings-SelectionMode="Single" MinFilterLength="2" DropDownWidth="200px"
OnClientRequesting="OnClientRequestingMachineWO"
OnEntryAdded="MachineWORadAutoCompleteBox_EntryAdded">
<WebServiceSettings Path="FeedbackForm.aspx" Method="LookupMachineWorkOrder" />
</telerik:RadAutoCompleteBox>

<asp:RequiredFieldValidator ID="MachineWORadAutoCompleteBoxValidator" ValidationGroup="Save"
runat="server" Display="Dynamic" ControlToValidate="MachineWORadAutoCompleteBox" ForeColor="red" ErrorMessage="*"></asp:RequiredFieldValidator>
</td>

With a required field validator, the validation is triggered the validation itself works fine the problem I get is that the Error message is wrapped to the next line even though the style tag explicitly says "no wrap". See attached picture as an example of what.

Form looking online the autocompletebox is wrapped around update panels and using an Ajax Manager you can specify if you want to render inline, I tried this out but it didn't have any effect.

Any ideas?

Thanks,
Germán

2 Answers, 1 is accepted

Sort by
0
Accepted
Magdalena
Telerik team
answered on 30 May 2014, 11:32 AM
Hello,

The wrapper of RadAutoCompleteBox control is a block element (div), This is the reason why the text (*) after this element wraps to the second line. The second reason is, that width of the radAutocompleteBox is set to 160 pixels and your <td> wrapper  is only 150 pixels width. to fix also this issue, we reset the width of the radSutoCompleteBox by width: auto. Please, apply the following to fix the issue:
.RadAutoCompleteBox {
    display: inline-block;
}
 
html .RadAutoCompleteBox {
    width: auto;
}
 
.validator {
    vertical-align: top;
}

Where .validator is CSS class added to asp validator
<asp:RequiredFieldValidator CssClass="validator"

We are sending you this video with testing and fixing the issue. Please, find also a sample project in the attachment.

Regards,
Magdalena
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Germán
Top achievements
Rank 1
answered on 03 Jun 2014, 07:59 AM
Thanks, it worked.
Tags
AutoCompleteBox
Asked by
Germán
Top achievements
Rank 1
Answers by
Magdalena
Telerik team
Germán
Top achievements
Rank 1
Share this question
or