using keys shift + F9

1 Answer 2 Views
GridView
Laurent
Top achievements
Rank 1
Iron
Iron
Laurent asked on 18 Aug 2025, 02:37 PM

Hello,
I want to use the following commands:
F9 and Shift+F9.
F9: OK.
Shift+F9: no response?
Do you have a solution?

Here is my code.

METHOD PRIVATE VOID GridFamille_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs ):

IF e:Shift THEN DO:
            CASE e:KEYCODE :
                WHEN System.Windows.Forms.Keys:F9 THEN DO:
                             MESSAGE 'SHITF + F9' e:KEYCODE:ToString()    VIEW-AS ALERT-BOX.
                END.                   
            END CASE.
        END. 
        ELSE DO: 
            CASE e:KEYCODE:   

                WHEN System.Windows.Forms.Keys:F9 THEN DO:

                      MESSAGE 'F9' e:KEYCODE:ToString()    VIEW-AS ALERT-BOX.

                END.                   
            END CASE.
        END.                                 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 18 Aug 2025, 02:54 PM

Hello, Laurent,

Note that the RadGridView handles mouse and keyboard input through a GridRowBehavior. Depending on the row type, RadGridView introduces different row behaviors. The following help article demonstrates how to use them: Row behaviors - WinForms GridView Control

The possible solution that I can suggest in your case is to create a custom GridDataRowBehavior and override the relevant method according to the keys you need to handle Shift+F9. Then register the new behavior in RadGridView. 

You can use the information in the referred documentation article, as well as the example provided in the following forum thread: https://www.telerik.com/forums/trigger-form-key-events-from-editor#5130201 

I hope this information is useful for you. Please let me know if you need further assistance.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Laurent
Top achievements
Rank 1
Iron
Iron
commented on 18 Aug 2025, 04:39 PM

thank you for your response but a use a Behavior. but shift is priority and the group shift+F9 is impossible.

CLASS fichier.parametres_etude.familles.class.clsBaseGridBehavior INHERITS Telerik.WinControls.UI.BaseGridBehavior: 
    
    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/
        
    CONSTRUCTOR PUBLIC clsBaseGridBehavior (  ):
        
        SUPER ().
        
    END CONSTRUCTOR.


    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC OVERRIDE LOGICAL ProcessKey(INPUT e AS System.Windows.Forms.KeyEventArgs ):
                                          
        IF e:KEYCODE EQ System.Windows.Forms.Keys:Delete AND e:CONTROL THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:C AND e:CONTROL THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:V AND e:CONTROL THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:Down AND e:CONTROL THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:Up AND e:CONTROL THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:F7 THEN RETURN FALSE.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:F9 AND e:shift THEN DO:
        MESSAGE 'clsBaseGridBehavior' SKIP e:shift SKIP e:KEYCODE 
        VIEW-AS ALERT-BOX.
            RETURN FALSE.
        END.
        IF e:KEYCODE EQ System.Windows.Forms.Keys:Tab THEN RETURN FALSE.
        
        
        RETURN SUPER:ProcessKey(e).
        
    END METHOD.
Tags
GridView
Asked by
Laurent
Top achievements
Rank 1
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or