Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 107
  • Last Modified:

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

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
Jitendra Patil
Asked:
Jitendra Patil
  • 3
  • 2
1 Solution
 
zephyr_hex (Megan)DeveloperCommented:
Can you please show us how you've defined the control?
0
 
Jitendra PatilSr.Software EngineerAuthor Commented:
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
 
zephyr_hex (Megan)DeveloperCommented:
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
 
Jitendra PatilSr.Software EngineerAuthor Commented:
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
 
Jitendra PatilSr.Software EngineerAuthor Commented:
I've the found the solution
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now