Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Devexpress 使用级联下拉菜单插入到ASPxGridView中_Devexpress_Aspxgridview - Fatal编程技术网

Devexpress 使用级联下拉菜单插入到ASPxGridView中

Devexpress 使用级联下拉菜单插入到ASPxGridView中,devexpress,aspxgridview,Devexpress,Aspxgridview,我正在使用DevExpress Gridview进行CRUD操作, 我正在跟踪链接。并且更新操作工作正常 我想插入新行,所以我在Gridview中添加了属性,它显示了create按钮 问题是,在新行中,当我改变国家时,它不会自动更新城市。它在更改国家下拉列表后调用JavaScript函数,但不调用C#code函数 下面是我的网格代码 <dx:ASPxGridView AutoGenerateColumns="false" ClientSid

我正在使用DevExpress Gridview进行CRUD操作, 我正在跟踪链接。并且更新操作工作正常

我想插入新行,所以我在Gridview中添加了属性,它显示了create按钮

问题是,在新行中,当我改变国家时,它不会自动更新城市。它在更改国家下拉列表后调用JavaScript函数,但不调用C#code函数

下面是我的网格代码

    <dx:ASPxGridView AutoGenerateColumns="false" 
                    ClientSideEvents-Init="OnInit" 
                    DataSourceID="dsMasterDataList"
                    ClientInstanceName="gvMasterDataList"
                    ID="gvMasterDataList" 
                    KeyFieldName="ID"
                    OnBatchUpdate="GvMasterDataList_BatchUpdate" 
                    OnCellEditorInitialize="gvMasterDataList_CellEditorInitialize" 
                    OnCommandButtonInitialize="gvMasterDataList_CommandButtonInitialize"
                    OnRowDeleted="gvMasterDataList_RowDeleted" 
                    OnRowInserted="gvMasterDataList_RowInserted" 
                    OnRowUpdated="gvMasterDataList_RowUpdated" 
                    OnRowValidating="gvMasterDataList_RowValidating"
                    OnSummaryDisplayText="gvMasterDataList_SummaryDisplayText" 
                    runat="server" >
<SettingsEditing Mode="Inline" />
                <Columns>
                    <dx:GridViewCommandColumn ButtonType="Image" Caption=" " FixedStyle="Left" ShowClearFilterButton="true" ShowDeleteButton="true" ShowNewButtonInHeader="true" Width="32" />
                    <dx:GridViewCommandColumn ShowEditButton="true" Caption=" " ShowClearFilterButton="true" />
                    <dx:GridViewDataTextColumn FieldName="ID" Visible="false" />
..
..

..
..

我需要在哪里进行更改才能使其正常工作?

主要思想是在“grid\u CellEditorInitialize”事件处理程序中忽略以下条件:

政务司司长:

VB:

”如果(不是grid.IsEditing)或lse e.Column.FieldName“City”,则
“回来
"完"
'如果e.KeyValue为DBNull.Value或LSE e.KeyValue为Nothing,则
“回来
"完"
对于“新”模式,它们总是正确的,并跳过rest代码逻辑


请在上查看独立于数据库的解决方案。

主要思想是在“grid\u CellEditorInitialize”事件处理程序中忽略以下条件:

政务司司长:

VB:

”如果(不是grid.IsEditing)或lse e.Column.FieldName“City”,则
“回来
"完"
'如果e.KeyValue为DBNull.Value或LSE e.KeyValue为Nothing,则
“回来
"完"
对于“新”模式,它们总是正确的,并跳过rest代码逻辑

请在上查看独立于db的解决方案

//if(!grid.IsEditing || e.Column.FieldName != "City") return;
//if(e.KeyValue == DBNull.Value || e.KeyValue == null) return;
'If (Not grid.IsEditing) OrElse e.Column.FieldName <> "City" Then
'   Return
'End If
'If e.KeyValue Is DBNull.Value OrElse e.KeyValue Is Nothing Then
'   Return
'End If