Saturday, March 24, 2012

Panel Closed

Hello

I use the autocompletextender and the CompletionListElementID="myPanel" because I want to use a scrollable area

my entire code is like this

 <asp:Panel runat="server" id="myPanel" Height="100px" ScrollBars="Vertical" ></asp:Panel> <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TBSearch" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionInterval="1" EnableCaching="true" CompletionSetCount="12" CompletionListElementID="myPanel" />
 
and I have a problem (of course)
The Panel open itself well and I get a scrollbar but when I click on the scrollbar to make it moving, the panel get closed.
 
Any ideas `?
 
Thx in advance 

Hi Gilloux,

I have wrote a sample based on your description but unable to reproduce your problem. My testing shows that scrollbar works fine. When click on it, the panel won't get closed unless you click on the list.

Here is my sample:

Aspx:

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TBSearch" runat="server"></asp:TextBox> <asp:Panel runat="server" ID="myPanel" Height="100px" ScrollBars="Vertical"> </asp:Panel> <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TBSearch" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionInterval="1" EnableCaching="true" CompletionSetCount="12" CompletionListElementID="myPanel" /> </form>

WebService:

<%@. WebService Language="C#" Class="AutoComplete" %>using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Collections.Generic;[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][System.Web.Script.Services.ScriptService]public class AutoComplete : System.Web.Services.WebService { public AutoComplete() { } [WebMethod] public string[] GetCompletionList(string prefixText, int count) { if (count == 0) { count = 10; } if (prefixText.Equals("xyz")) { return new string[0]; } Random random = new Random(); List<string> items = new List<string>(count); for (int i = 0; i < count; i++) { char c1 = (char)random.Next(65, 90); char c2 = (char)random.Next(97, 122); char c3 = (char)random.Next(97, 122); items.Add(prefixText + c1 + c2 + c3); } return items.ToArray(); }}

My system environments: VS2005 + Asp.Net 2.0 Ajax Extensions V1.0 + Ajax Control Toolkit V10618 +Windows 2003.

Please compare your code with mine.If it doesn't work, please confirm whether your Control Toolkit Version is the latest release version or not. If not , please upgrade it.

Hope this help.

Best regards,

Jonathan

No comments:

Post a Comment