I am creating one typeahead textbox with checbox list. i.e when start typing in textbox will popup the checkboxlist. i have done this with popup control extender with checkbox list. i have 2 problems here
1. while typing the checkbox list not changing, it should be list autocomplete
2. Multiple selection gives problem. Once i select any item the checkbox list closed. each time i can select only one checkbox.
You may first debug to see without any event in TextBox, if the popup will close when you multi-select the checkboxlist. As you are in an UpdatePanel and the checkboxlist is autopostback, so the part of the page will re-rendered.
rameshdotv
Member
31 Points
15 Posts
popupcontrol extender closes the panel after commit with checkboxlist
Dec 12, 2011 09:29 AM|LINK
Hi,
I am creating one typeahead textbox with checbox list. i.e when start typing in textbox will popup the checkboxlist. i have done this with popup control extender with checkbox list. i have 2 problems here
1. while typing the checkbox list not changing, it should be list autocomplete
2. Multiple selection gives problem. Once i select any item the checkbox list closed. each time i can select only one checkbox.
my code
<div><asp:TextBox ID
="txtCountry"
runat="server" Skinid="longTextbox" AutoPostBack = "true"
OnClientItemSelected="passtohidden()"
ontextchanged="txtCountry_TextChanged" ></asp:TextBox
>
<asp:Panel ID="pnlLocation" runat="server"
>
<asp:UpdatePanel runat="server" ID="upLocation"
>
<ContentTemplate
>
<asp:CheckBoxList ID="chkLocation" SkinID ="chkColor" runat="server" AutoPostBack = "true"
onselectedindexchanged
="chkLocation_SelectedIndexChanged">
</asp:CheckBoxList
>
</ContentTemplate
>
<Triggers
>
<asp:AsyncPostBackTrigger ControlID="txtCountry"
EventName="TextChanged"
/>
</Triggers
>
</asp:UpdatePanel
>
</asp:Panel
>
<asp:PopupControlExtender ID="Panel1_PopupControlExtender" runat="server"
Enabled="True" Position="Bottom" PopupControlID = "pnlLocation"
TargetControlID
="txtCountry">
</asp:PopupControlExtender
>
<asp:HiddenField ID="hdntypedtext" runat="server"
/>
</div> <div>protected void chkLocation_SelectedIndexChanged(object sender, EventArgs e) { string strSelected = ""; foreach (ListItem l in chkLocation.Items) { if (l.Selected) strSelected += l.Text + " ,"; } //txtCountry.Text = strSelected; Panel1_PopupControlExtender.Commit(strSelected); }</div>Please help me to resolve this
Thanks & Regards
V.Ramesh
BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: popupcontrol extender closes the panel after commit with checkboxlist
Dec 14, 2011 03:06 AM|LINK
Hello
You may first debug to see without any event in TextBox, if the popup will close when you multi-select the checkboxlist. As you are in an UpdatePanel and the checkboxlist is autopostback, so the part of the page will re-rendered.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
rameshdotv
Member
31 Points
15 Posts
Re: popupcontrol extender closes the panel after commit with checkboxlist
Feb 21, 2012 11:23 AM|LINK
after removing the updated panel and used some javascript for autocomplete. it worked. Also multi selection also done by javascript.
thanks