开发者

AjaxControlToolkit DropDownExtender inside a table always displays associated panel

开发者 https://www.devze.com 2022-12-19 08:23 出处:网络
I have a textarea that has the ajaxcontroltoolkit dropdownextender associated with it, and a panel that contains a gridview with the options for the user to select from.

I have a textarea that has the ajaxcontroltoolkit dropdownextender associated with it, and a panel that contains a gridview with the options for the user to select from.

Here is the code for these items:

    <asp:UpdatePanel ID="updPnlView" UpdateMode="Conditional" runat="server">
<ContentTemplate>
    <asp:TextBox ID="txtSiteName" runat="server" TextMode="MultiLine" Rows="4" Columns="33" ReadOnly="true" /></td>
    <ajaxToolkit:DropDownExtender runat="server" ID="popupdropdown" 
    DropDownControlID="pnlGrid" TargetControlID="txtSiteName" />
    <asp:Panel runat="server" ID="pnlGrid" Style="display: none; visibility: hidden" Height="300" ScrollBars="Vertical"> 
         <asp:GridView ID="gvSite" runat="server" AutoGenerateColumns="False" Width="100%" 
            DataKeyNames="ID,FullAddress" DataSourceID="odsSite" OnRowDataBound="gvSite_RowDataBound" 
            ShowFooter="false" ShowHeader="false" OnSelectedIndexChanged="gvSite_SelectedIndexChanged" >
            <Columns>
                <asp:CommandFiel开发者_Go百科d ButtonType="Link" SelectText="Select" ShowSelectButton="true" ItemStyle-CssClass="HiddenColumn" />
                <asp:TemplateField >
                     <ItemTemplate>
                         <asp:Label ID="FullAddress" runat="server" Text='<%# Eval("FullAddress").ToString().Replace("\n", "<br/>") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>
                <asp:CheckBoxField DataField="DisabledFLG" ItemStyle-CssClass="HiddenColumn" />
            </Columns>
        </asp:GridView>
    </asp:Panel>
    <asp:ObjectDataSource ID="odsSite" runat="server" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetList"
        TypeName="SOM.DCO.MOGWAI.Bll.SiteManager"
        onselecting="odsSite_Selecting" SortParameterName="SortExpression" 
        onselected="odsSite_Selected" >
        <SelectParameters>
            <asp:Parameter Name="myCriteria" Type="Object" />
            <asp:Parameter Name="myIDs" Type="Object" />
            <asp:Parameter Name="sortExpression" Type="String" />
            <asp:Parameter Name="bypassCache" Type="Boolean" />
        </SelectParameters>
    </asp:ObjectDataSource>
</ContentTemplate>
</asp:UpdatePanel>

When I place this item inside a table (i.e. <table><tr><td>THE CODE ABOVE</td></tr></table>) the panel always shows completely open never hidden. It also completely fills out the available space within the TD and pushes all other text on the page down the screen. If I take the associated controls out of the table, it works as expected. I have duplicated this issue in both Firefox and IE8.

What gives?


well, with further testing, I was able to prove that this only happens if the control referenced by the dropdownextender is a gridview.

I changed it to a listview control instead and it works as it should.

I assume this is a bug, but I can't find any record of it anywhere.

I also tested to see if it had the same behavior when the gridview was inside a panel that was not referenced by the dropdownextender, but it did not occur. So it's definitely related to the dropdownextender.

0

精彩评论

暂无评论...
验证码 换一张
取 消