2

enter image description here

I have an Ajax Toolkit combobox in a web page, which have a master page. The Combobox is inside a table.When the webpage loads the listitems of this combo box are appearing below far away from the combo box.

What is the fix?? :(

Sin
  • 1,836
  • 2
  • 17
  • 24
  • No one here to help on this issue?? – Sin Sep 18 '12 at 05:13
  • @AnnL... do u have any solution for me? – Sin Sep 19 '12 at 09:14
  • I will come back to this this evening and see if I can make any suggestions. – Ann L. Sep 19 '12 at 17:30
  • I don't have a solution, but if you use the appropriate tool for whatever browser this is happening in, you ought to be able to see what CSS and HTML location and position settings apply to the list items at the time they appear. This should tell you something about what's causing this - whether it's a margin thing, a positioning thing, or something completely different. Good luck! – Ann L. Sep 19 '12 at 23:48
  • Also, look at this post. This person seems to have the some problem you did: http://stackoverflow.com/questions/5485153/weird-ajax-combobox-drop-down-list?rq=1 – Ann L. Sep 19 '12 at 23:49

4 Answers4

5
.ajax__combobox_itemlist
{
position:absolute!important; 
height: 100px !important;
overflow: auto !important;
top: auto !important;
left: auto !important;
}

It's work perfectly....

mikdiet
  • 9,859
  • 8
  • 59
  • 68
sonu
  • 51
  • 1
  • 1
4

I'm having the same problem. It's a well listed bug that is also in the ajaxcontrolkit autocompleteextender. Basically, the calculations for where the list will be placed inside the page are wrong.

There are lots of fixes for this, but they're a pain to use, so just do this:

combobox1_OptionList{
    position: fixed !important
}

It changes the way the calculations are made, which luckily makes it accurate.

Note: if your containing div will change position on window resize (e.g left: 10%; top 50%;) then when you change your window size, the combo box list will not move under the combo box and will be left behind. However, each time the combo box list is triggered its position is recalculated, so adding a javascript event for a window resize that turns the comboboxlist off might do the trick.

Dan
  • 59,490
  • 13
  • 101
  • 110
0

Try wrapping the ComboBox in a div. I had the very same problem. I added a class to each ComboBox div and added the following css.

.cbox
{
    margin: 0 auto;
    width: 280px;
}

Set the width according to your preference. Margin: auto places the div centrally within the parent according to the width.

-1

Kindly look at this sample

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx

ComboBox Known Issues

When ListItemHoverCssClass is specified and the ComboBox list is scrollable, highlighting a list item will cause the scrollbar to flicker when using the Internet Explorer web browser. To avoid this issue, do not specify the ListItemHoverCssClass property.

if this doesn't solve a problem mention your markup for combobox in comment

thanks

Vishal Sharma
  • 2,773
  • 2
  • 24
  • 36