Last active
July 21, 2022 22:21
-
-
Save strepicor/5e70c0e0e99d726e65f3a5498dc847dd to your computer and use it in GitHub Desktop.
EpiUltraGrid Cell Edit Mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exit, Enter Cell Edit mode when user navigates grid column cells with Up, Down Keys in UltraGrid | |
private void grdName_KeyDown(object sender, System.Windows.Forms.KeyEventArgs args) | |
{ | |
if ((args.KeyCode == Keys.Down)) | |
{ | |
grdAttributes.PerformAction(UltraGridAction.ExitEditMode); | |
grdAttributes.PerformAction(UltraGridAction.BelowCell); | |
args.Handled = true; | |
grdAttributes.PerformAction(UltraGridAction.EnterEditMode); | |
} | |
else if ((args.KeyCode == Keys.Up)) | |
{ | |
grdAttributes.PerformAction(UltraGridAction.ExitEditMode); | |
grdAttributes.PerformAction(UltraGridAction.AboveCell); | |
args.Handled = true; | |
grdAttributes.PerformAction(UltraGridAction.EnterEditMode); | |
} | |
} | |
// Exit Edit mode after changing grid cell values programatically | |
grdName.PerformAction(UltraGridAction.ExitEditMode); | |
grdName.UpdateData(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment