1 pièce(s) jointe(s)
[OpenEdge Architect] Problème de focus sur UltraGrid
Bonjour,
Je débute en technologies Progress (quelques jours...) et je suis déjà confronté à un problème que je n'aurais jamais cru pouvoir affronter après avoir trouvé ça simplissime dans d'autres technologies.
Voilà mon problème :
j'ai une UltraGrid et je dois changer de focus (cellule sélectionnée) lorsque j'appuie sur entrée.
Je pense avoir trouvé la plupart des choses qui me sont utiles... sauf comment affecter le focus physiquement à la cellule. Et c'est assez problématique.
Quelqu'un dans sa toute bonté aurait-il une piste à me donner?
Merci.
Voici ce qui est déjà fait :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
/*------------------------------------------------------------------------------
Purpose: Gestion de la tabulation avec la touche entrée.
Notes:
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID grd_Customer_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs ):
/* Déclarations des variables */
DEFINE VARIABLE in_Row AS INTEGER NO-UNDO. /*Lignes*/
DEFINE VARIABLE in_Col AS INTEGER NO-UNDO. /*Colonnes*/
/*DEFINE VARIABLE ch_Editeur AS CHARACTER NO-UNDO.*/ /* editeur pour mettre en gras le nom de la colonne où se trouve l'index.....*/
DEFINE VARIABLE in_KC AS INTEGER NO-UNDO. /* KeyCode en numérique 0-9*/
/* affichage du keycode de la touche pressée, à effacer après le tests.*/
ASSIGN in_KC = e:KeyValue.
MESSAGE "KeyCode de la touche pressée : " in_KC SKIP
"TabIndex = " grd_Customer:TabIndex SKIP
"Index colonne = " grd_Customer:ActiveCell:Column:Index SKIP
"Index ligne = " grd_Customer:ActiveRow:Index VIEW-AS ALERT-BOX.
/* C'est pas le tabIndex qui bouge*/
/* KeyValue étant en lecture seule, on ne peut pas lui ré-affecter la valeur soouhaitée :
ENTER = 13 / RIGHT = 39 / TAB = 9
------> ne pas utiliser 39 dans ce cas. Si la cellule est active on n'en sort pas*/
/* IF in_KC = 13 THEN e:KeyValue = 39. ----> Impossible */
/*ASSIGN in_ColIndex = grd_Customer:c*/
DEFINE VARIABLE in_indexCol AS INTEGER NO-UNDO.
ASSIGN in_indexCol = grd_Customer:ActiveCell:Column:Index.
ASSIGN in_indexCol = in_indexCol + 1.
IF in_KC = 13 THEN
RETURN.
END METHOD. |
Merci de votre aide !