Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1640
Detecting tab key on the last cell in a row
posted

I have an event defined to automaticlly add a new row when the user tabs out of the last cell.  The problem is that this event fires wwhen the user enters the last cell rather than after leaving it with the tab key.  My current logic is below - how should it be fixed?

grid.AfterPerformAction += new AfterUltraGridPerformActionEventHandler(OnGridPerformAction);

public static void OnGridPerformAction(object sender, AfterUltraGridPerformActionEventArgs e)

{

    if (sender != null && sender is UltraGrid)

       {

        UltraGrid grid = (UltraGrid)sender;

        if (e.UltraGridAction == UltraGridAction.NextCellByTab)

              {

            if ((grid.CurrentState & UltraGridState.CellLast) == UltraGridState.CellLast)

                         AddBlankGridRow(grid);

               }
        }

}

Parents
No Data
Reply
  • 469350
    Offline posted

    Have you considered just setting AllowAddNew to AllowAddNew.TemplateOnBottom? In this mode, modifying the template add row makes it become an add row and a new template add row shows up under it so the user can just tab into it and start typing.

Children
No Data