Override some default TrueDBGrid keyboard shortcuts

Originally Posted 6 December 2016, 3:40 am EST

  • Originally Posted 6 December 2016, 3:40 am EST

    The C1 TrueDBGrid comes with default keyboard interaction shortcuts. Is there a way to override some of these defaults? For example, I would like the Home key to take me to the top of the grid, and the End key to the bottom of the grid, instead of their default behavior.
  • Marked as Answer

    Reply

    Hello,

    In order to accomplish your requirement, I would suggest to use KeyDown event of C1TrueDBGrid.

    if (!c1TrueDBGrid1.EditActive)
    {
    if (e.KeyCode == Keys.Home)
    {

    c1TrueDBGrid1.MoveFirst();
    e.SuppressKeyPress = true;
    e.Handled = true;
    }
    else if (e.KeyCode == Keys.End)
    {
    c1TrueDBGrid1.MoveLast();
    e.SuppressKeyPress = true;
    e.Handled = true;
    }
    }


    ~Pragati
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels