473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Padding AutoCompletionList to the right of TextBox

By default, the AutoCompletion List will display to the left of its Target textbox.Left positions of both Textbox and AutoCompletionList is same.

Is there a way or CSS Settings to align the same to the right, so that both AutoCompletionList and TextBox end with same right positions.

I have AutoCompleteExtender mapped for a TextBox. When the AutoCompleteList gets displayed, it is postioned to left same as TextBox left position, which is it's default behaviour.

As my AutoCompleteList has wide data, i want the list to right aligned with the textbox.

No style for textbox.
Below is the .aspx
Expand|Select|Wrap|Line Numbers
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head runat="server">
  3.     <title></title>
  4.     <style>
  5.         .completionListElement
  6.         {
  7.             background-color: ivory;
  8.             color: black;
  9.             border: solid 1px gray;
  10.             cursor: pointer;
  11.             font-family: Arial;
  12.             font-size: 10pt;
  13.             width: auto !important;
  14.         }
  15.         .listItem
  16.         {
  17.         }
  18.         .highlightedListItem
  19.         {
  20.             background-color: Gray;
  21.             color: Red;
  22.         }
  23.         .txt
  24.         {
  25.             background-repeat: no-repeat;
  26.             background-position: right;
  27.         }
  28.     </style>
  29. </head>
  30. <body>
  31.     <form id="form1" runat="server">
  32.     <cc1:ToolkitScriptManager runat="server" ID="tcm">
  33.     <Services>
  34.             <asp:ServiceReference Path="~/WebService1.asmx"  />
  35.         </Services>
  36.     </cc1:ToolkitScriptManager>
  37.  
  38.     <table width="100%" border="1">
  39.         <tr>
  40.             <td width="50%">
  41.                 <asp:Button ID="Button1" runat="server" Text="Button" />
  42.             </td>
  43.             <td width="50%" align="right">
  44.                 <asp:TextBox runat="server" ID="txtComments"> </asp:TextBox>
  45.  
  46.                 <cc1:AutoCompleteExtender ID="ace1" runat="server" TargetControlID="txtComments"
  47.                     CompletionListCssClass="completionListElement" CompletionListItemCssClass="listItem"
  48.                     CompletionListHighlightedItemCssClass="highlightedListItem" ServicePath="~/WebService1.asmx"
  49.                     ServiceMethod="HelloWorld" MinimumPrefixLength="3" 
  50.                     EnableCaching="true"  CompletionListElementID="divlist"></cc1:AutoCompleteExtender>
  51.                 <div id="divlist" runat="server">
  52.                 </div>
  53.             </td>
  54.         </tr>
  55.     </table>
  56.     </form>
  57. </body>
  58. </html>
Mar 2 '11 #1
2 1719
Frinavale
9,735 Expert Mod 8TB
I'm not sure what you're trying to do...

Did you try setting the TextBox's style to text-align:right?

-Frinny
Mar 2 '11 #2
Frinavale
9,735 Expert Mod 8TB
I understand you now :)
What css styles are being applied to the textbox?

-Frinny
Mar 2 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Gustaf Liljegren | last post by:
I use to trust Firefox, but in this case, I don't know what to think. My test page: http://gusgus.cn/test/index.html IE6 does the right thing. The containting <div> is 600px, and within it,...
11
by: Mr. B | last post by:
While at first this may seem a simple tast, it has plagued me for a while... What I want to do is to have the background colour of something like a TextBox to change from (say) White to Yellow to...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
4
by: Becker | last post by:
I want two asp:texbox controls to be exactly right beside one another with no padding or spacing between them. I am really struggling how to make this happen. Any ideas? Thanks, Ben
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
2
by: André | last post by:
Hi, I made a detailsview containing several fields for inserting only. I also made a dropdownlist which is invisible at start. Now, when clicking in a particular textbox, the dropdownlist must...
8
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
5
by: dizzy77 | last post by:
I'am putting this question in this forum as this is I think this is html issue rather than asp.net. How can I make cell get right its border displayed and aligned with upper cell??? <table...
6
by: maya | last post by:
hi, I recently discovered the hard way that when you had padding-right or padding-left to a div it increases the with of the div... how do you add left-padding or right-padding to a div w/o...
2
by: ShirishKumar | last post by:
hi to all, We are developing some website with asp.net having some css files . We want the browser to work and design to be constant in both in IE ( Internet Explorer & FireFox) . Its working...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.