Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

16 Experts available now in Live!

Get 1:1 Help Now