Reputation:
I use the Autocomplete extender feature to get the list of suggestions from my database. There is no scroll bar for this control, so I have added a scroll bar in a panel (MS .net 2.0) which i attach to my autocomplete extender.Now the issue is with the srcoll bar. like this
<asp:Panel ID="autocompleteDropDownPanel" runat="server" ScrollBars="Auto" Height="100px" HorizontalAlign="Left" />
and add it to autocompete extender like this
:CompletionListElementID="autocompleteDropDownPanel"
When I call my page, I get the list of suggestions and the scroll bar appears. When I click on scroll bar or try to drag, everything just disappears.
Am i doing something wrong? Is there any other way to add a scroll bar to my autocomplete extender control
Any hints would be very helpful.
Upvotes: 1
Views: 9572
Reputation: 56
the click on the scrollbar issue was in my case fixed by setting AutoPostBack=false
on the textbox. But then the functionality of the AutoCompleteExtender were gone. Using the OnClientItemSelected
property I could call a javascript function that triggered a postback and all the IE browser users were happy again :-)
Upvotes: 0
Reputation: 611
I just encountered the same symptoms when using the AutoCompleteExtender
in ASP.NET 3.5.....this was because I had AutoPostBack=True
on the textbox, turning this off made the scroll bar function properly.
(I know this isn't the same scenario as the original question but I found this from google while trying to fix my problem so it seemed appropriate to post my solution.)
Upvotes: 1
Reputation: 364
well this is solved right now in visual studio 2008 sp1 ajaxtoolkit and you can provaid scrolling to list but editing the css of CompletionListCssClass set
overflow:auto;
height:60px;
Upvotes: 1
Reputation: 523
I have a similar issue looks like it has not been resolved.
Clicking the AutoCompleteExtender scrollbar causes postback when attached to a TextBox where AutoPostBack="true".
Steps to reproduce:
It seems like what we need is a way of temporarily disabling the AutoPostBack behavior whenever the drop down is displayed or perhaps just when a person tries to scroll. Maybe clicking down on the scrollbar could set some sort of flag that would disable the AutoPostback, and then releasing the mouse would re-enable it. I don't know how feasible this is, but it sure would be nice if someone had an idea.
http://www.codeplex.com/AjaxControlToolkit/WorkItem/View.aspx?WorkItemId=15161
Upvotes: 1
Reputation: 54127
This does not directly answer your question - but I would ask if you're sure that the autocomplete extender is the best control to be using in this scenario.
From a usability perspective the great thing about autocomplete is that I can type a 3-4 characters, see a few available inputs and easily select them using the keyboard using a few down-cursor keypresses.
If you are displaying more items in the autocomplete list than can be easily viewed on screen then I'm not sure that the fix is to add a scrollbar.
In our scenario we had a list of 2800 names that were available in the autocomplete. We limited the number shown to 20, but set the MinimumPrefixLength
to 1. This meant that when the user typed one character they would see an autocomplete list that effectively just lets them know that the textbox they're typing in has this ability. The list of results in the list only becomes really useful once the user has entered 3-4 characters though.
Upvotes: 1