Posted 19 December 2023, 5:18 am EST
Is it possible,as before, to have the KeyActionEnter to Right so that it follows the row?
Thanx you
Forums Home / ComponentOne / WPF Edition
Posted by: devcode.ou on 19 December 2023, 5:18 am EST
Posted 19 December 2023, 5:18 am EST
Is it possible,as before, to have the KeyActionEnter to Right so that it follows the row?
Thanx you
Posted 20 December 2023, 2:23 am 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