Solved

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

Posted on 2016-09-22
5
28 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 42

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 42

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now