如何禁用 Devexpress 网格中的 'new item row' 区域
How to disable 'new item row' area in Devexpress grid
我在 Devexpress 中有一个网格视图。在网格的顶部,我有一个空白
允许我向网格添加新客户端的区域。问题是
当我点击右栏附近的空白区域时,就好像我有
单击 'Supprimer' 按钮。我想禁用那个正确的区域,这样当我点击它时,什么也不会发生。所以这意味着,如果我单击空白区域的左侧,我只能添加一个新客户端。
我试过使用 ShowingEditor 但无法正常工作:
Private Sub gvException_ShowingEditor(sender As Object, e As CancelEventArgs) Handles gvException.ShowingEditor
If gvException.IsNewItemRow(gvException.FocusedRowHandle) Then
gvException.Columns("Supprimer").OptionsColumn.ReadOnly = True
buttonDeleteException.Buttons(0).Caption = "Supprimer"
'e.Cancel = True
Else
gvException.Columns("Supprimer").OptionsColumn.ReadOnly = False
e.Cancel = False
End If
End Sub
使用这个:
Private Sub gvException_ShowingEditor(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles gvException.ShowingEditor
If gvException.IsNewItemRow(gvException.FocusedRowHandle) and gvException.FocusedColumn.FieldName = "Supprimer" Then
e.Cancel = True
End If
End Sub
我在 Devexpress 中有一个网格视图。在网格的顶部,我有一个空白 允许我向网格添加新客户端的区域。问题是 当我点击右栏附近的空白区域时,就好像我有 单击 'Supprimer' 按钮。我想禁用那个正确的区域,这样当我点击它时,什么也不会发生。所以这意味着,如果我单击空白区域的左侧,我只能添加一个新客户端。
我试过使用 ShowingEditor 但无法正常工作:
Private Sub gvException_ShowingEditor(sender As Object, e As CancelEventArgs) Handles gvException.ShowingEditor
If gvException.IsNewItemRow(gvException.FocusedRowHandle) Then
gvException.Columns("Supprimer").OptionsColumn.ReadOnly = True
buttonDeleteException.Buttons(0).Caption = "Supprimer"
'e.Cancel = True
Else
gvException.Columns("Supprimer").OptionsColumn.ReadOnly = False
e.Cancel = False
End If
End Sub
使用这个:
Private Sub gvException_ShowingEditor(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles gvException.ShowingEditor
If gvException.IsNewItemRow(gvException.FocusedRowHandle) and gvException.FocusedColumn.FieldName = "Supprimer" Then
e.Cancel = True
End If
End Sub