2011-05-03 45 views
2

我目前在弹出控件中有GridViewGridView嵌入在UpdatePanel中,我弹出的窗口上没有显示任何内容。但是,当我通过它进行调试时,我看到GridView中有数据并且被绑定,但我没有注意到任何更改。我甚至试图调用UpdatePanel上的更新方法,但没有收到任何更改。gridview在ASP.NET的updatepanel中不可见

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

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#后端的,我可以证明,因为我们使用的是一个公司的具体在其他情况下运行良好的查询工具。

感谢

+0

粘贴我们的代码,以便我们可以找到问题 – 2011-05-03 16:09:54

+2

这将有助于查看更多的代码。 – chprpipr 2011-05-03 16:10:48

+0

你是什么意思'基本上我想要做的是显示一个空白页面,直到我的数据已被加载。在GridView绑定数据后,我希望它可见。请找到当前进程的下面的代码片段。如果你的数据没有加载,它将自动显示任何内容,如果你真的想显示一个空白页面给用户,让他/她等待尝试,你可以尝试'Thread.Sleep ()'或'TimeSpan'检查[Thread.Sleep方法](http://msdn.microsoft.com/en-us/library/system.threading.thread.sleep(v = vs.71).aspx) – Bastardo 2011-05-03 20:16:07

回答

1

你肯定有一个UpdatePanel为内容的ASPxPopupControl支持?我试着摆脱UpdatePanel,看看GridView是否按预期的那样工作,或者尝试在ASPxPopupControl之外移动UpdatePanel(其中GridView仍在里面),看看是否有效。如果问题出在ASPxPopupControl之内UpdatePanel,那么您可能需要联系DevExpress获得更多帮助,因为这会让我相信这是他们控制的问题。

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

+0

我已经能够在没有UpdatePanel的情况下拥有GridView加载。我插入UpdatePanel的唯一原因是直观地显示查询在后台运行。 – Seb 2011-05-03 18:32:54

+0

这几乎为我做了这份工作。我只需要稍微调整一下就可以做我想做的事。谢谢(你的)信息。 – Seb 2011-05-04 13:26:24

+0

有这个问题,并删除更新面板修复它。谢谢 – 2012-01-19 00:37:14