DevExpress 隐藏的 GridView CSS 问题
我有一个中继器控件,它为绑定到中继器的每个项目重复 DevExpress ASPxGridView。中继器包含在更新面板内。 UpdatePanel 外部的页面上的事件会触发 UpdatePanel(以及随后的中继器)进行更新。如果存在绑定到中继器的记录,则一切正常。中继器为每条记录呈现一个网格,并且所有样式看起来都很完美。
如果页面最初加载并且中继器中没有可显示的项目,则不会渲染网格(到目前为止按预期工作)。如果最终添加记录并且转发器重新绑定(由于触发了 UpdatePanel),则不会显示网格样式。如果刷新整个页面,网格的样式就会完美显示。请记住,我使用的是网格附带的默认样式之一,因此这些样式是从 AXD 中提取的,并且不包含在我的 MasterPage 中。
发布的代码有点太多,但标记的本质看起来与此类似:
<asp:UpdatePanel ID="the UpdatePanelInQuestion" runat="server" UpdateMode="Conditional">
<asp:Repeater ID="theRepeaterInQuestion" runat="server" OnItemDataBound="theMethodThatHandlesGridPopulation">
<ItemTemplate>
<dxwgv:ASPxGridView ID="theGridViewInQuestion" runat="server" EnableViewState="false">
<Columns>
...
</Columns>
</ItemTemplate>
</asp:Repeater>
</asp:UpdatePanel>
有关如何使网格样式正确显示的任何想法,而无需: 1)刷新整个页面而不是触发。 2) 在页面上放置另一个空网格,样式为“display: none;”强制下载样式。
I have a repeater control that repeats a DevExpress ASPxGridView for every item bound to the repeater. The repeater is contained within an update panel. Events on the page, outside of the UpdatePanel, trigger the UpdatePanel (and subsequently the repeater) to update. All works fine if records are present to bind to the repeater. The repeater renders a grid for each record and all styles look perfect.
If the page initially loads and there are no items to display in the repeater, no grids are rendered (works as intended up until this point). If a record is eventually added and the repeater rebinds (because of the triggered UpdatePanel), the grid styles don't display. If the entire page is refreshed, the grid's styles display perfectly. Keep in mind that I'm using one of the default styles that comes with the grid, so these are being pulled from an AXD and not included in my MasterPage.
A bit too much code to post, but the nuts of the markup looks similar to this:
<asp:UpdatePanel ID="the UpdatePanelInQuestion" runat="server" UpdateMode="Conditional">
<asp:Repeater ID="theRepeaterInQuestion" runat="server" OnItemDataBound="theMethodThatHandlesGridPopulation">
<ItemTemplate>
<dxwgv:ASPxGridView ID="theGridViewInQuestion" runat="server" EnableViewState="false">
<Columns>
...
</Columns>
</ItemTemplate>
</asp:Repeater>
</asp:UpdatePanel>
Any ideas on how to make the styles of the grid display correctly without:
1) Refreshing the entire page instead of triggering.
2) Placing another empty grid on the page with style="display: none;" to force the styles to download.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此问题是由于 DX ASP.NET 控件所需的脚本最初未在页面上注册而导致的。可以通过 DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterBaseScript 方法显式注册它们。
请检查http://www.devexpress.com/issue=B191046支持中心票证有关此问题。
This problem is caused by the fact that the required scripts for the DX ASP.NET controls are not registered on the page initially. It is possible to register them explicitely via the DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterBaseScript method.
Please check the http://www.devexpress.com/issue=B191046 Support Center ticket regarding this.