Solved

Ajax control toolkit Auto Complete Extender + Suggestion list not displaying words with multiple spaces

Posted on 2016-09-22
5
41 Views
Last Modified: 2016-10-01
Hi Guys,

I am working with Ajax control toolkit autocomplete extender, it is working fine with database call and everything, but i am having problem while displaying the suggestion list to the user.

i have database value as " Word1                        word2", but in the suggestion list it displays "word1 word2".

any help is appreciated.
0
Comment
Question by:jitendra patil
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 41811054
Can you please show us how you've defined the control?
0
 
LVL 12

Author Comment

by:jitendra patil
ID: 41811931
Below is the markup code
<asp:TextBox ID="txtTherapyRecommendation" runat="server" width="355px" MaxLength="4000" 
	autocomplete="off" onblur="CheckSelectionfromSuggested(this)" onfocus="SetTherapyContextKey(this);" 		
onkeyup="SetTherapyContextKey(this);"  CssClass="txt_main" oncontextmenu="return false" oncut="return false">
</asp:TextBox>

<ajaxtoolkit:AutoCompleteExtender ID="ACETherapyRecommendation" runat="server" CompletionInterval="500"
	CompletionListCssClass="completionListElement" CompletionListElementID="dvTPTherapy"
	UseContextKey="true" CompletionListHighlightedItemCssClass="highlightedListItem"
	CompletionListItemCssClass="listItem" CompletionSetCount="10" EnableCaching="true"
	MinimumPrefixLength="0" ServiceMethod="SearchRecommendvalues" ServicePath="../charting/WebServGeneral.asmx"
	TargetControlID="txtTherapyRecommendation" OnClientItemSelected="GetReasonID" OnClientPopulated="SetPopulatedData">
</ajaxtoolkit:AutoCompleteExtender>

<asp:HiddenField ID="hdnTherapyRecommendedID" runat="server" />
<asp:Panel ID="dvTPTherapy" runat="server" CssClass="divCustomWidth" 
	Style="position:relative; height: 200px !important; z-index: 10; border-width: medium; display: none; width:360px!important">
</asp:Panel>

Open in new window

below is the css used in the panel
.txt_main
{
	font-family: tahoma;
	font-size: 11px;
	color: #000000;
	text-decoration: none;
	line-height: 14px;
	font-weight: normal;
}
.divCustomWidth
{
	border: 1px solid gray !important;
	margin: 1 px !important;
	height: 350px;
	overflow: auto;
	background-color: white;
}

Open in new window

0
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 41812638
I was hoping to see some kind of delimiter setting in your control, but that doesn't appear to be the issue.  My only guess is to inspect the CSS in F12 developer tools, or remove all CSS to verify that's not the cause.
0
 
LVL 12

Accepted Solution

by:
jitendra patil earned 0 total points
ID: 41815768
hi zephyr_hex thanks for the support,

I have solved the issue, it was the CSS of AutocompleteExtender's  CompletionListItemCssClass  and listItem class that was having White-space: nowrap;  

I changed it to white-space:pre !important; and the issue is solved.
0
 
LVL 12

Author Closing Comment

by:jitendra patil
ID: 41824640
I've the found the solution
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question