c# - gridview 在 ASP.NET 的更新面板中不可见

标签 c# asp.net visual-studio-2010 gridview updatepanel

我目前在弹出控件中有一个 GridViewGridView 嵌入在 UpdatePanel 中,我有一个弹出窗口,上面什么也没有显示。但是,当我通过它进行调试时,我看到 GridView 中有数据并且已绑定(bind),但我没有注意到任何变化。我什至尝试在 UpdatePanel 上调用 Update 方法,但也没有收到任何更改。

基本上,我希望做的是在加载我的数据之前显示一个空白页面。在 GridView 绑定(bind)数据后,我希望它是可见的。请找到当前进程的以下代码片段。

ASPX 来源:

<dx:ASPxPopupControl ID="ASPxPopupItem" runat="server" ClientIDMode="AutoID" LoadingPanelImagePosition="Bottom"
    Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
    EnableAnimation="False" HeaderText="Item Checker" 
    Width="614px">
    <ContentCollection>
        <dx:PopupControlContentControl ID="PopupCoverageItem" runat="server" SupportsDisabledAttribute="True">
            <table style="width: 611px" cellpadding="3" cellspacing="3">
                <tr>
                    <td align="center">
                        Title
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div style="height: 75px; overflow: auto; width: 595px;">
                            <asp:UpdatePanel runat="server" ID="udpItems" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:GridView runat="server" ID="gvTitles" Width="575px" AutoGenerateColumns="false">
                                        <Columns>
                                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="90px">
                                                <ItemTemplate>
                                                    <center>
                                                        <asp:ImageButton OnClick="btnSelect_Click" ID="lnk_Select" runat="server" CommandArgument='<%# Eval("title") %>'
                                                            ImageUrl="~/images/save.png" ToolTip="Choose this record" />
                                                    </center>
                                                </ItemTemplate>
                                                <HeaderStyle Width="90px"></HeaderStyle>
                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                            </asp:TemplateField>
                                            <asp:BoundField HeaderText="Item ID" DataField="item_id" SortExpression="item_id" />
                                            <asp:BoundField HeaderText="Title" DataField="title" SortExpression="title" />
                                            <asp:BoundField HeaderText="Date" DataField="date" SortExpression="date" />
                                        </Columns>
                                    </asp:GridView>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <asp:Button runat="server" ID="btnCancelTitle" Text="Cancel" CssClass="popupButton"
                            OnClick="btnCancelTitle_Click" />
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>

C# 后端:

// Bind the data from the returning SQL query and update
            gv.DataSource = npgDat;
            gv.DataBind();
            udpItems.Update();

不幸的是,我无法展示更多的 C# 后端,因为我们使用的是公司特定的查询工具,该工具在其他情况下运行良好。

谢谢

最佳答案

您确定 ASPxPopupControl 支持将 UpdatePanel 作为内容吗?我会尝试摆脱 UpdatePanel 并查看 GridView 是否按预期工作,或者尝试移动 UpdatePanel(使用 GridView 仍在其中)在 ASPxPopupControl 之外,看看是否可行。如果问题是 ASPxPopupControl 中的 UpdatePanel,那么您可能需要联系 DevExpress 以获得更多帮助,因为这会让我相信这是他们的问题控制。

更新
根据您在下面的评论,您可能需要查看 Example: How to show the ASPxLoadingPanel while the content is loading inside the ASPxPopupControl在 DevExpress 支持论坛上。

关于c# - gridview 在 ASP.NET 的更新面板中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5872399/

相关文章:

c# - Gitversion 回滚了 AzureDevops 构建管道中我的 NuGet 包的版本号

c# - 单元测试 : How to return value asynchronously from mocked interface

javascript - Uncaught ReferenceError : show value is not defined(Only for mobile device)

c# - IoC比较

c++ - 使用 C++ 创建 HTML 报告

visual-studio-2010 - 关闭代码合约警告

c# - 关于继承IDisposable的细节?

c# - 调试时 Visual Studio 显示错误值?

c# - 如何让 GridView 为空?

.net - Visual Studio 2010 远程调试 - 无法连接 : Access Denied