我有一个 Telerik RadGrid,它的列已生成。 RadGrid 是分层的,我有 RadWindows,我可以在其中向网格添加/删除/修改动态列,并且当 RadWindow 关闭时 RadGrid 会刷新。
我的 RadWindow:
<telerik:RadWindow ID="RadWindow1" runat="server" KeepInScreenBounds="true" CssClass="Columns"
Title="Manage Columns" OnClientClose="refreshGrid" EnableViewState="false"
Width="740" Height="330">
</telerik:RadWindow>
refreshGrid Javascript 函数:
function refreshGrid(sender) {
$find("<%= RadGrid1.ClientID %>").get_masterTableView().rebind();
showScrollBars();
}
如果我在第一级添加/修改/删除列,则此函数有效,但它不适用于详细表。更确切地说,详细信息表在服务器端正确刷新,但在客户端未刷新。有人知道这个问题的原因吗?
我在 Telerik 论坛上找到了一个页面,但没有帮助:
http://www.telerik.com/community/forums/aspnet-ajax/grid/details-table-not-refreshed-in-spite-of-detailtabledatabind-is-fired.aspx
如有任何帮助/建议,我们将不胜感激。
I have a Telerik RadGrid and its columns are generated. The RadGrid is hierarchical and I have RadWindows where I can add/delete/modify dinamically columns to my grid and the RadGrid is refreshed when the RadWindow is closed.
My RadWindow:
<telerik:RadWindow ID="RadWindow1" runat="server" KeepInScreenBounds="true" CssClass="Columns"
Title="Manage Columns" OnClientClose="refreshGrid" EnableViewState="false"
Width="740" Height="330">
</telerik:RadWindow>
refreshGrid Javascript function:
function refreshGrid(sender) {
$find("<%= RadGrid1.ClientID %>").get_masterTableView().rebind();
showScrollBars();
}
This works if I add/modify/delete column(s) in the first level, but it doesn't work for Detail Tables. More exactly the detail tables are refreshed correctly on the server side, but it's not refreshed on client side. Does anybody know the cause of this problem?
I've found a page on the Telerik forum, but it didn't help:
http://www.telerik.com/community/forums/aspnet-ajax/grid/details-table-not-refreshed-in-spite-of-detailtabledatabind-is-fired.aspx
Any help/ advice is appreciated.
发布评论
评论(2)
您是否在与 RadGrid 相关的页面上使用任何形式的 Ajax?我想,正如该论坛帖子中指出的那样,部分回发可能存在问题,不一定会根据需要更新控件。因此,如果您使用 RadAjaxManager,我建议您稍微过分地使用哪个控件更新页面上的其他控件,然后向后(慢慢地删除项目)看看是否会得到不同的结果。或者,您也可以使用以下客户端脚本(这应该可以工作,尽管我没有在本地测试它):
我在这里所做的只是在 MasterTableView 及其第一个 DetailTableView 上调用重新绑定。可能感觉有点难看,但它会强制刷新详细信息表:) 对于更多客户端好东西,我建议阅读 这篇文档文章。
Are you using any form of Ajax on your page relating to the RadGrid? I guess, as pointed out in that forum thread, that there could be an issue with partial postbacks not necessarily updating the control as necessary. So, if you are using the RadAjaxManager I recommend going a bit overboard with which control updates the other controls on the page and then go backwards (slowly taking items off) to see if you get a different result. Alternatively you could also use the following client-side script (this should work, although I have not tested it locally):
What I'm doing here is just calling rebind on both the MasterTableView and it's first DetailTableView. Might feel a bit ugly, but it will force the detail table to refresh :) For more client-side goodies I recommend reading over this documentation article.
目前 Telerik 不支持此功能,有关详细信息,请访问 此页面。
This functionality is not supported in Telerik in this moment, for more information go to this page.