Home Forums WinForms controls Xceed Grid for WinForms Double click on grid?? Reply To: Double click on grid??

User (Old forums)
Member
Post count: 23064

You need to use the AddHandler method rather then the “+=” in C#.

e.g.:

//at Form_Load
<i>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

AddHandler GridControl1.Columns( 0 ).CellEditorManager.ActivatingControl, AddressOf CellEditorManager_ActivatingControl
AddHandler GridControl1.Columns( 0 ).CellEditorManager.DeactivatingControl, AddressOf CellEditorManager_DeactivatingControl

End Sub
</i>

//Event handlers :
<i>
Private Sub CellEditorManager_ActivatingControl( ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs )

Dim editor as Xceed.Editors.WinTextBox = CType( e.Control, Xceed.Editors.WinTextBox)
AddHandler editor.TextBoxArea.TextChanged, AddressOf editor_TextChanged

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)
‘this needs to be done, if not, subscriptions will pill up every time the editor is activated
RemoveHandler editor.TextBoxArea.TextChanged, AddressOf editor_TextChanged

End Sub

Private sub editor_TextChanged(ByVal sender As System.Object, ByVal e As EventArgs )

Dim value as String = CType( sender, TextBoxArea ).Text

End Sub
</i>

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