Flexgrid KeyActionEnter .NET

Posted by: devcode.ou on 18 December 2023, 8:18 pm EST

  • Posted 18 December 2023, 8:18 pm EST

    Is it possible,as before, to have the KeyActionEnter to Right so that it follows the row?

    Thanx you

  • Posted 19 December 2023, 5:23 pm EST

    Hi Beniamino,

    C1FlexGrid .NET Framework API 4.6.2 provides a KeyActionEnter.MoveAcross to move rightwards across a row in C1FlexGrid.

    However, there does not exist any such feature in FlexGrid .NET6 and .NET8 API. We have escalated this enhancement request to the developers with internal tracking ID: C1XAML-35426. We will update you on this as soon as we hear back from them.

    For the time being you can consider a workaround to handle FlexGrid’s PreviewKeyDown event as shown in the following code snippet to achieve the desired behavior:

    flexgrid.PreviewKeyDown += (s, e) =>
    {
        GridCellRange rng = flexgrid.CursorRange;
        if (rng != null && e.Key == Key.Enter)
        {
            if (rng.Column2 != flexgrid.Columns.Count - 1)
            {
                flexgrid.SetCursor(rng.Row2, rng.Column2 + 1);
            }
            else if (rng.Row2 != flexgrid.Rows.Count - 1)
            {
                flexgrid.Select(rng.Row2 + 1, 0);
                flexgrid.SetCursor(rng.Row2 + 1, 0);
            }
        }
    };

    Kindly refer to the attached sample for full implementation. See MoverAcross.zip

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels