Home Forums WinForms controls Xceed Grid for WinForms Cell value changed event Reply To: Cell value changed event

User (Old forums)
Member
Post count: 23064

You need to do it on the CellEditorManager, and the implementation will depend on the editor that is used for the cell / column.
<i>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
</i>
//do it before filling the data to the gird <i>
AddHandler GridControl2.Columns( 1 ).CellEditorManager.ActivatingControl, AddressOf CellEditorManager_ActivatingControl
AddHandler GridControl2.Columns( 1 ).CellEditorManager.DeactivatingControl, AddressOf CellEditorManager_DeactivatingControl

End Sub

Private Sub CellEditorManager_ActivatingControl( ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs )
</i>
//The cast must correspond to the editor set as the CellEditorManager, by default a WinTextBox for string columns<i>
Dim editor as Xceed.Editors.WinTextBox = CType( e.Control, Xceed.Editors.WinTextBox)
AddHandler editor.TextBoxArea.KeyDown, AddressOf editor_KeyDown

End Sub

Private Sub CellEditorManager_DeactivatingControl( ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs )

Dim editor as Xceed.Editors.WinTextBox = CType( e.Control, Xceed.Editors.WinTextBox)
RemoveHandler editor.TextBoxArea.KeyDown, AddressOf editor_KeyDown

End Sub

Private sub editor_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs )
</i>
‘Your keydown event code here
<i>
End Sub
</i>

Imported from legacy forums. Posted by André (had 299 views)