Home › Forums › WinForms controls › Xceed Grid for WinForms › TextEditor OnClick event › Reply To: TextEditor OnClick event
Ops!
Itsn’t a bug… :-$
The reason for this is that the controls are cloned in the grid so to activate the even I need an intermediate event.
This is the bugfixed inherited class:
<color=”Blue”>
Public Class MyValueCellEditor : Inherits Xceed.Grid.Editors.TextEditor
Public Sub New()
Dim btn as New Xceed.Editors.WinButton(“Click me!”)
AddHandler btn.Click, AddressOf SideButton_OnClick
Me.SideButtons.Add(btn)
End Sub
Private Sub SideButton_OnClick (sender as Object, e as System.EventArgs)
‘ Do Some Actions…
End Sub
</color><color=”Red”>
Private Sub ParamValueCellEditor_ActivatingControl(ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs) Handles MyBase.ActivatingControl
Dim winTextBox As Xceed.Editors.WinTextBox = CType(e.Control, Xceed.Editors.WinTextBox)
AddHandler winTextBox.SideButtons(0).Click, AddressOf DropButton_Click
End Sub
Private Sub ParamValueCellEditor_DeactivatingControl(ByVal sender As Object, ByVal e As Xceed.Grid.Editors.CellEditorEventArgs) Handles MyBase.DeactivatingControl
Dim winTextBox As Xceed.Editors.WinTextBox = CType(e.Control, Xceed.Editors.WinTextBox)
RemoveHandler winTextBox.SideButtons(0).Click, AddressOf DropButton_Click
End Sub
</color><color=”Blue”>
End Class
</color>
I hope this thread can help you…
Imported from legacy forums. Posted by oarrivi (had 2949 views)