Information générale
Catégorie:
Codage, syntaxe et commandes
I have some code written that is supposed to update a business class when the user presses enter in a textbox. I use the KeyPress method and look for keycode 13. What the program is supposed to do is to go to the next row in the grid, and set the focus back to the textbox. The grid is bound to the same business object I am updating, and when the row changes in the grid, a details view also gets updates.
My problem is that the AfterRowColChange method is not getting fired when I press enter in the textbox. I advanced the cursor and refreshed the grid, but because the focus has not been set to the grid, the AfterRowColChange is not fired.
How do I set the focus to the grid after I press the enter key?
The grid name is errorGrid.
I tried
errorGrid.SetFocus()
errorGrid.Column1.SetFocus()
But this does not fire the AfterRowColChange.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement