Asp更新面板 - 详细信息视图更新底层GridView不 [英] Asp Update Panel - Details View Updates Underlying GridView doesn't

查看:111
本文介绍了Asp更新面板 - 详细信息视图更新底层GridView不的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上有一个Asp.net gridview,当点击buttonfield(而不是select)时,它会打开一个弹出窗体(我的popup不是asp的),它包含可编辑DetailsView中显示的gridview行的细节。 (这种方法已被使用,因为网格包含20个宽的列,并且它更容易在detailsView格式中进行编辑/更新)DetailsView会采取任何修改并将它们写回到表中,但是,基础GridView从未被直观地更新,除非当然这个页面是完全重新加载的(我尝试使用Windows.reload函数,但是我感到恼人的winddows正试图重新打开等,错误,所以这是没用的)。我试图找到获取gridview刷新数据的最佳方式。我已经通过一个Me.ClientScript.RegisterStartupScript(Me.GetType()eyc,一个警告框来放置,以在detailsview的'更新步骤'触发时进行通信,以便插入一个gridview.ReBind(),但因为detailsview被保存在更新面板,例如,Protected Sub DetailsView2_ItemUpdated(ByVal sender As Object,ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs)处理DetailsView2.ItemUpdated函数,以及roqwupdatind等等,看起来不会触发。他们当然必须这样做,否则表格将不会更新。我的问题是我如何在包含详细视图的面板中与更新事件进行通信,以便我可以在主GridView上发生重新绑定。

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

推荐答案

详细信息视图有一个名为

Detail view have an event called

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

其中dvEbook是我的详细视图。

where dvEbook is my detail view.

它会调用相同的页面。

我希望它适合您。

谢谢

这篇关于Asp更新面板 - 详细信息视图更新底层GridView不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆