值未反映在 RadGrid 中 ItemCommand 的更改中

Value not reflected on change in ItemCommand within RadGrid

我有一个包含 MasterTableView 和 DetailView 的 RadGrid。我试图在删除 DetailView 行时更改 MasterTableView 中存在的 Sub Total 的值。我能够在 Parent Table 中获得控制权并且能够更改值。然而价值并没有体现出来。我尝试了多种选择,例如Rebind() 方法以及 e.Item.OwnerTableView.DataBind()。这是我的 ItemCommand 函数的样子

    Private Sub dbgView_ItemCommand(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles dbgView.ItemCommand
            If e.CommandName.ToLower.Equals(GlobalConstants.Key_Delete_CommandName) And e.Item.OwnerTableView.Name = "Tax" Then
                   dataItem = DirectCast(e.Item.OwnerTableView.ParentItem, GridDataItem)
                   Dim numSubTotal As NumericBox = dataItem.FindControl("numAmount")
                   numSubTotal.Text = "New Value"
                   ' e.Item.OwnerTableView.DataBind()
            End If

谁能帮我理解为什么新值没有反映出来?这是我的网格的样子

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="dbgView">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="dbgView"></telerik:AjaxUpdatedControl>
                           </telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid ID="dbgView" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                PageSize="5" GridLines="Horizontal" Skin="Office2010Blue" Style="border: 0 none"
                AllowAutomaticInserts="True">
                <PagerStyle Mode="NumericPages"></PagerStyle>
                <MasterTableView Width="100%" CommandItemDisplay="Top" Name="GLLine" AllowNaturalSort="False"
                    PageSize="10" DataKeyNames="Key" NoDetailRecordsText="No records to display.">
                    <DetailTables> .....

更新 在做进一步的挖掘时,我知道我需要重新绑定网格 post 我的操作已执行。但是,当我执行重新绑定时,出现异常

[HttpException (0x80004005): DataBinding: 'System.Collections.DictionaryEntry' 不包含名称为 'TaxID' 的 属性。] System.Web.UI.DataBinder.GetPropertyValue(对象容器, String propName) +384 Telerik.Web.UI.GridTableView.PopulateDataKey(对象数据项,DataKey 键,字符串名称) +457 Telerik.Web.UI.GridTableView.PopulateDataKeys(对象数据项)+241

但是我在正常操作期间没有遇到这个问题。对于所有正常操作,我能够找到此数据密钥。可能出了什么问题?

更新 根据以下来自 Telerik 的 link,删除详细信息 table 行时不会更新主 table。

http://www.telerik.com/forums/master-grid-not-rebinding-after-detail-table-delete-command

我正在尝试重新绑定,正如本网站中提到的那样。但是,如上所述,我收到 DataKeyValues 的异常。任何指针都会有帮助。

问题已解决!!我得到了很多指导我执行 Rebind() 操作的链接。然而,这开始产生多个其他问题。这个问题是通过编写一个 Javascript 方法来处理 GridButtonColumn 的 onclick 事件的,方法是从 DetailView 和 Master Table View 传递字段的控件 ID。