Skip to content

Instantly share code, notes, and snippets.

@strepicor
Last active July 21, 2022 22:21
Show Gist options
  • Save strepicor/5e70c0e0e99d726e65f3a5498dc847dd to your computer and use it in GitHub Desktop.
Save strepicor/5e70c0e0e99d726e65f3a5498dc847dd to your computer and use it in GitHub Desktop.
EpiUltraGrid Cell Edit Mode
// 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