Asp 更新面板 - GridView 底层的详细信息视图更新不会

发布于 2024-11-04 08:05:39 字数 717 浏览 2 评论 0原文

我在页面上有一个 Asp.net gridview,当单击按钮字段(而不是选择)时,它会打开一个弹出表单(我的弹出窗口不是 asp 的),其中包含显示在可编辑的 DetailsView 中的 gridview 行的详细信息。 (使用这种方法是因为网格包含 20 个较宽的列,并且以详细信息视图格式更容易编辑/更新)详细信息视图接受任何修改并将它们写回到表中,很好,但底层的 Gridview 永远不会在视觉上更新,除非当然,页面已完全重新加载(我尝试使用 Windows.reload 函数,但我得到了烦人的 Windows 正在尝试重新打开等错误,因此这是无用的)。我试图找到让 gridview 刷新其数据的最佳方法。我已经通过 Me.ClientScript.RegisterStartupScript(Me.GetType() eyc)放置了一个警报框,以便在详细信息视图的“更新步骤”触发时进行通信,以便我可以插入 gridview.ReBind() 但因为详细信息视图保存在更新面板,例如,Protected Sub DetailsView2_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs) 处理DetailsView2.ItemUpdated 函数,而 roqwupdatind 等函数似乎不会触发(。当然,他们必须这样做,否则表格将不会更新。我的问题是如何与包含详细信息视图的面板中的更新事件进行通信,以便我可以在主网格视图上进行重新绑定,谢谢。你

I have an Asp.net gridview on a page, when a buttonfield is clicked (instead of select) it opens a popup form (my popup not asp's) which contains the detail of the gridview row displayed in an editable DetailsView. (This approach has been used because the grid contains 20 wideish columns and it is easier to edit / update in the detailsView format) The DetailsView takes any amendmends and writes them back to the table, fine, but the underlying Gridview is never visually updated unless of course the page is completely reloaded (I tried to use the Windows.reload function but I get the annoying winddows is trying to reopen etc, error, so that is useless). I am trying to discover the best way to get the gridview to refresh it's data. I have placed via a Me.ClientScript.RegisterStartupScript(Me.GetType() eyc, an alert box to communicate when the 'update steps' of the detailsview fires so I could interject a gridview.ReBind() but because the detailsview is held within the update panel the, for example, Protected Sub DetailsView2_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs) Handles DetailsView2.ItemUpdated functions, and the roqwupdatind and so one, do not appear to fire. (they must do of course else the table would not be updating. MY problem is how do I 'communicate with update events within the panel contained detailsviews so that I can cause a reBind to occur on the main gridview. Any Ideas would be appreciated. Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城泪 2024-11-11 08:05:39

详细视图有一个名为的事件

protected void dvEbook_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
        {
            Response.Redirect(Request.RawUrl,false);
        }

,其中 dvEbook 是我的详细视图。

它将调用同一页面。

我希望它对你有用。

谢谢

Detail view have an event called

protected void dvEbook_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
        {
            Response.Redirect(Request.RawUrl,false);
        }

where dvEbook is my detail view.

It will call a same page.

I hope it will work for you.

Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文