CommandName =AddCssClass =GridAddbtnrunat =server/> < asp:Button ID =btnDeleteToolTip =DeleteCommandArgument =RowId CommandName =删除CssClass =GridDeletebtn运行at =server/> < HeaderStyle Font-Bold =trueFont-Names =TahomaFont-Size =12pxWidth = 5%BackColor =#8DC894ForeColor =GreenHorizo​​ntalAlign =Left/> < itemstyle horizo​​ntalalign =Right> < ; alternatingrowstyle backcolor =#C2D69B> < HeaderStyle BackColor =Green>< / HeaderStyle> 解决方案 find('AutoCompleteEx'); if(!behavior._height){ var target = behavior.get_completionList(); 行为。 _height = target.offset高度 - 2; target.style.height ='0px'; }/> <% - 从在淡入时0px到适当的大小 - %> < parallel duration =。4> < fadein> &l t; length propertykey =heightstartvalue =0endvaluescript = find('AutoCompleteEx')._ height> < onhide> <% - 折扣为0px并淡出 - %> < parallel duration =。4> < fadeout>< length propertykey =heightstartvalue script = find('AutoCompleteEx')._ heightendvalue =0> < HeaderStyle Font-Bold =true字体名称=Tahoma字体大小=12px宽度=35%BackColor =#8DC894 ForeColor =GreenHorizo​​ntalAlign =Left/> < itemstyle horizo​​ntalalign =Left> < asp:TemplateField> ; < itemtemplate> < asp:Button ID =btnAddNewRowToolTip =Add New ContractCommandArgument =RowId CommandName =AddCssClass =GridAddbtnrunat =server/> < asp:Button ID =btnDeleteToolTip =DeleteCom mandArgument =RowIdCommandName =DeleteCssClass =GridDeletebtnrunat =server/> < HeaderStyle Font-Bold =true字体-Names =Tahoma字体大小=12px宽度=5%BackColor =#8DC894ForeColor =绿色Horizo​​ntalAlign =Left/> < itemstyle horizo​​ntalalign =正确> < alternatingrowstyle backcolor =#C2D69B> < HeaderStyle BackColor =Green>< / HeaderStyle> I have a gridview. i'm using AutoCompleteExtender inside gridview. I have add and delete button inside gridview. when i added second row AutoCompleteExtenderis not working.<asp:GridView ID="grdItems" runat="server" AutoGenerateColumns="False" Font-Names="Arial" ClientIDMode="Static" CssClass="table table-striped table-bordered table-hover" Width="100%" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B" HeaderStyle-BackColor="green" AllowPaging="True" ShowFooter="True" OnRowCommand="grdItems_RowCommand" DataKeyNames="RowId"><columns> <asp:TemplateField HeaderText="ItemName"> <itemtemplate> <asp:TextBox ID="txtItem" runat="server" CssClass="form-control" OnTextChanged="txtItem_TextChanged" AutoPostBack="true" text='<%# Bind("ItemName") %>' autocomplete="off" TabIndex="1"> <asp:HiddenField ID="txtItemId" runat="server" Value='<%# Bind("ItemId") %>' /> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" BehaviorID="AutoCompleteEx" TargetControlID="txtItem" ServicePath="../../WebServices/AutoComplete.asmx" ServiceMethod="GetItems" MinimumPrefixLength="1" CompletionInterval="200" EnableCaching="true" CompletionSetCount="20" DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompletionListItem="true" CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"> <animations> <onshow> <sequence> <%-- Make the completion list transparent and then show it --%> <opacityaction opacity="0"> <hideaction visible="true"> <%--Cache the original size of the completion list the first time the animation is played and then set it to zero --%> <ScriptAction Script=" // Cache the size and setup the initial size var behavior = $find('AutoCompleteEx'); if (!behavior._height) { var target = behavior.get_completionList(); behavior._height = target.offsetHeight - 2; target.style.height = '0px'; }" /> <%-- Expand from 0px to the appropriate size while fading in --%> <parallel duration=".4"> <fadein> <length propertykey="height" startvalue="0" endvaluescript="$find('AutoCompleteEx')._height"> <onhide> <%-- Collapse down to 0px and fade out --%><parallel duration=".4"><fadeout><length propertykey="height" startvaluescript="$find('AutoCompleteEx')._height" endvalue="0"> <HeaderStyle Font-Bold="true" Font-Names="Tahoma" Font-Size="12px" Width="35%" BackColor="#8DC894" ForeColor="Green" HorizontalAlign="Left" /> <itemstyle horizontalalign="Left"> <asp:TemplateField> <itemtemplate> <asp:Button ID="btnAddNewRow" ToolTip="Add New Contract" CommandArgument="RowId" CommandName="Add" CssClass="GridAddbtn" runat="server" /><asp:Button ID="btnDelete" ToolTip="Delete" CommandArgument="RowId" CommandName="Delete" CssClass="GridDeletebtn" runat="server" /><HeaderStyle Font-Bold="true" Font-Names="Tahoma" Font-Size="12px" Width="5%" BackColor="#8DC894" ForeColor="Green" HorizontalAlign="Left" /> <itemstyle horizontalalign="Right"><alternatingrowstyle backcolor="#C2D69B"><HeaderStyle BackColor="Green"></HeaderStyle> 解决方案 find('AutoCompleteEx'); if (!behavior._height) { var target = behavior.get_completionList(); behavior._height = target.offsetHeight - 2; target.style.height = '0px'; }" /> <%-- Expand from 0px to the appropriate size while fading in --%> <parallel duration=".4"> <fadein> <length propertykey="height" startvalue="0" endvaluescript="find('AutoCompleteEx')._height"> <onhide> <%-- Collapse down to 0px and fade out --%><parallel duration=".4"><fadeout><length propertykey="height" startvaluescript="find('AutoCompleteEx')._height" endvalue="0"> <HeaderStyle Font-Bold="true" Font-Names="Tahoma" Font-Size="12px" Width="35%" BackColor="#8DC894" ForeColor="Green" HorizontalAlign="Left" /> <itemstyle horizontalalign="Left"> <asp:TemplateField> <itemtemplate> <asp:Button ID="btnAddNewRow" ToolTip="Add New Contract" CommandArgument="RowId" CommandName="Add" CssClass="GridAddbtn" runat="server" /><asp:Button ID="btnDelete" ToolTip="Delete" CommandArgument="RowId" CommandName="Delete" CssClass="GridDeletebtn" runat="server" /><HeaderStyle Font-Bold="true" Font-Names="Tahoma" Font-Size="12px" Width="5%" BackColor="#8DC894" ForeColor="Green" HorizontalAlign="Left" /> <itemstyle horizontalalign="Right"><alternatingrowstyle backcolor="#C2D69B"><HeaderStyle BackColor="Green"></HeaderStyle> 这篇关于gridview isue中的AutoCompleteExtender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 02:50