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

Keyboard equivalents in GDBG

I have a couple of questions regarding keyboard equivalents to mouse actions : 1) For a PushButton control, is there a keyboard equivalent to a mouse click? I''ve tried space and I see the button depress like it''s been clicked, but the CellButtonClicked event doesn''t fire. 2) I put some code in ProcessCmdKey to handle a Alt-Down keystroke to show the dropdown on some custom cell models that I have. I keyed off of whether ButtonSize was 0,0 or not to determine whether there was a button present in the cell. This was working well until I changed my ActivateCurrentCellBehavior from ClickOnCell to SetCurrent. I now get an error on my ShowDropDown call. Is there another way to cause the dropdown to appear? Thanks!

6 Replies

AD Administrator Syncfusion Team June 9, 2004 10:41 AM

1) The PushButtonClick event should fire when you press space on a PushButton cell. (But the CellButtonClicked does not.) 2) What error are you getting? The change to SetCurrent means that the cell control will normally be active for edit when you press alt+down, and this was not always the case before. One thing you could try is to call CurrentCell.Deactivate before you call CurrentCell.ShowDropDown. This may make things work if the problem is trying to drop your control while the cell is actively being edited.


LS Lori S. Pearsall June 9, 2004 11:06 AM

1) That worked! 2) NullReferenceException I''ve tried the following and still get the error : if (!this.CurrentCell.IsDroppedDown) { GridCurrentCell holdCurrentCell = this.CurrentCell; holdCurrentCell.Deactivate(false); while (holdCurrentCell.IsInDeactivate) { } holdCurrentCell.ShowDropDown(); return true; } >1) The PushButtonClick event should fire when you press space on a PushButton cell. (But the CellButtonClicked does not.) > >2) What error are you getting? > >The change to SetCurrent means that the cell control will normally be active for edit when you press alt+down, and this was not always the case before. One thing you could try is to call CurrentCell.Deactivate before you call CurrentCell.ShowDropDown. This may make things work if the problem is trying to drop your control while the cell is actively being edited.


AD Administrator Syncfusion Team June 9, 2004 11:09 AM

What is null? If you can post a sample project showing the problem, we can try to spot something here.


LS Lori S. Pearsall June 9, 2004 11:28 AM

I''ve overridden GridTextBoxCellModel to create a textbox with a dropdown form if a lot of text is to be entered. The call to ShowDropDown() fails with "dropDownImp is null". I''ve verified that only those cells that do have a dropdown are having the code above executed. If you need a sample, that will take a little while but let me know.


AD Administrator Syncfusion Team June 9, 2004 11:43 AM

Are you dynamically changing the celltype of this celll in some event like QueryCellInfo or PrepareViewStyleInfo. Sometimes, the cell my be initialized using the old celltype (that maybe does not have a dropdown) before the new celltype is applied, and this is why the null reference. If you cannot spot something and post a sample, we can try to spot something here.


LS Lori S. Pearsall June 9, 2004 07:48 PM

I decided to go a different way and expose my OnButtonClicked methods in the custom dropdown grid controls. Thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon