We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Derived ComboBox

1. How can I capture key events in the list derived from GridComboBoxListBoxPart when deriving own CellType from GridComboBox? I want to allow the user to change the selection in the ComboBox with keys or mouse. Therefor I need to capture key events to change selection on Arrow Up/Down and Enter. 2. I capture the MouseUp event of the list box part and change the controlvalue to the selected value. Then I do a HidePopup(PopupType.Done) to close the listboxpart. However the current cell isn't redrawn correctly. Am I doing anything wrong - meaning is there a better way to change ControlValue and close the dropdown or why it isn't redrawn? Regards Peter

3 Replies

AD Administrator Syncfusion Team April 4, 2003 07:02 AM UTC

1) You might be able to do this work in the renderer's ProcessKeyEventArgs. Catch the mousdouwn, get the keystroke, do the work and then return true.
Protected Overrides Function ProcessKeyEventArgs(ByRef m As System.Windows.Forms.Message) As Boolean
	If m.Msg = WM_KEYDOWN Then
		Dim keyCode As Keys = CType(m.WParam.ToInt32(), Keys) And Keys.KeyCode
		System.Console.WriteLine("KeyDown ->" + keyCode.ToString())
		Return True 'handled
        End If
End Function
2) After closing the dropdown, try calling CurrentCell.Refresh to see if that handles things, or you might also try calling CurrentCell.ConfirmChanges().


AD Administrator Syncfusion Team April 4, 2003 08:58 AM UTC

2) Something else to try is to call CurrentCell.CloseDropDown instead of calling HidePopup directly (you bypass the grid otherwise and the grid can’t react)


PE Peter April 4, 2003 10:00 AM UTC

Thanx Clay, I tried ConfirmChanges and it works. Peter

Loader.
Live Chat Icon For mobile
Up arrow icon