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);
} }
}