我目前在弹出控件中有GridView
。 GridView
嵌入在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#后端的,我可以证明,因为我们使用的是一个公司的具体在其他情况下运行良好的查询工具。
感谢
粘贴我们的代码,以便我们可以找到问题 – 2011-05-03 16:09:54
这将有助于查看更多的代码。 – chprpipr 2011-05-03 16:10:48
你是什么意思'基本上我想要做的是显示一个空白页面,直到我的数据已被加载。在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