从我一直在阅读的内容来看, e.NewValues 应该填充已更新的新值,因为 FieldName 传递给它。但我每次都为空。
这是调试视图。我正在更改 ShalePlay 字段的值,并且 RowValidating 事件按预期触发。但是检查 NewValue 会返回 null。
关于我在这里做错了什么的任何想法?
编辑:标记:
<dx:ASPxGridView
ID="gvLocation"
runat="server"
AutoGenerateColumns="False"
DataSourceID="esmdsLocation"
ClientInstanceName="gvLocation"
ViewStateMode="Disabled"
KeyFieldName="LocationPK"
Width="600px"
OnCellEditorInitialize="gvLocation_CellEditorInitialize"
OnCommandButtonInitialize="gvLocation_CommandButtonInitialize"
OnStartRowEditing="gvLocation_StartRowEditing"
OnRowValidating="gvLocation_RowValidating">
<%-- <ClientSideEvents BeginCallback="
function(s, e) {loadingPanel.Show();}"
EndCallback="
function(s, e) {loadingPanel.Hide();}" />--%>
<Columns>
<dx:GridViewCommandColumn VisibleIndex="0">
<EditButton Visible="True">
</EditButton>
<NewButton Visible="True">
</NewButton>
</dx:GridViewCommandColumn>
<dx:GridViewDataHyperLinkColumn FieldName="LocationPK" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="1">
<DataItemTemplate>
<a href="javascript:void(0);" onclick="gvLocation_LinkClick('<%# Container.VisibleIndex %>');"><%# DataBinder.Eval(Container.DataItem,"LocationPK") %></a>
</DataItemTemplate>
</dx:GridViewDataHyperLinkColumn>
<dx:GridViewDataTextColumn FieldName="LocationName" ShowInCustomizationForm="True" VisibleIndex="2" />
<dx:GridViewDataComboBoxColumn FieldName="FieldType" ShowInCustomizationForm="True" VisibleIndex="3" />
<dx:GridViewDataComboBoxColumn FieldName="County" ShowInCustomizationForm="True" VisibleIndex="4" />
<dx:GridViewDataComboBoxColumn FieldName="State" ShowInCustomizationForm="True" VisibleIndex="5" />
<dx:GridViewDataComboBoxColumn FieldName="ShalePlay" ShowInCustomizationForm="True" VisibleIndex="6" />
</Columns>
<Settings ShowFilterBar="Visible" ShowFilterRow="True" ShowGroupPanel="True" />
<SettingsBehavior AllowFocusedRow="True" />
<SettingsLoadingPanel Mode="Disabled" />