Hi ,
I have Add the AllowAddNew property to add the new row as fallow.
grdTest.DisplayLayout.Bands(0).Override.AllowAddNew = _ Infragistics.Win.UltraWinGrid.AllowAddNew.FixedAddRowOnTop
I am able to add a new row if the user presses enter, or a tab at the end of the last cell that is fine for me.
Scenario 1: -
We i tab out of the last cell the focus should be on the first row of the added row (commited row), but it is going to the second row. ?? . It Should go to the first row.
Scenario 2: -
Not able to add row on tab out for the first row ( when grid don`t have commited rows). But able to add the row on Enter Key press.
Scenario 3: -
How to set the foucs to the 3rd cell of the next template row, after user press the enter key on the template row.
Please help me ASAP.
Thanks
Subbu.
Hi Subbu,
subbu25 said: Scenario 1: - We i tab out of the last cell the focus should be on the first row of the added row (commited row), but it is going to the second row. ?? . It Should go to the first row.
I tried using the BeforePerformAction event to get this to happen, but it doesn't seem like there is any easy way to do it. Why would you want this behavior, though? If the user enters data in the AddNew row and tabs out, why would they want to come back to the beginning of the same row again? It doesn't really make sense.
subbu25 said: Scenario 2: - Not able to add row on tab out for the first row ( when grid don`t have commited rows). But able to add the row on Enter Key press.
I was able to achieve something like that with this code:
private void ultraGrid1_BeforePerformAction(object sender, BeforeUltraGridPerformActionEventArgs e) { UltraGrid grid = (UltraGrid)sender; if (e.UltraGridAction == UltraGridAction.NextCellByTab && grid.CurrentState == (UltraGridState.Cell | UltraGridState.CellLast | UltraGridState.InEdit | UltraGridState.Row | UltraGridState.RowFirst | UltraGridState.RowFirstChild | UltraGridState.RowLast | UltraGridState.RowLastChild | UltraGridState.RowDirty | UltraGridState.FirstRowInGrid | UltraGridState.LastRowInGrid | UltraGridState.AddRow)) { grid.PerformAction(UltraGridAction.CommitRow); } }
subbu25 said: Hi , I have Add the AllowAddNew property to add the new row as fallow. grdTest.DisplayLayout.Bands(0).Override.AllowAddNew = _ Infragistics.Win.UltraWinGrid.AllowAddNew.FixedAddRowOnTop I am able to add a new row if the user presses enter, or a tab at the end of the last cell that is fine for me. Scenario 1: - We i tab out of the last cell the focus should be on the first row of the added row (commited row), but it is going to the second row. ?? . It Should go to the first row. Scenario 2: - Not able to add row on tab out for the first row ( when grid don`t have commited rows). But able to add the row on Enter Key press. Scenario 3: - How to set the foucs to the 3rd cell of the next template row, after user press the enter key on the template row.
I think if you set TabStop to false on the first two columns, it will skip over them and go to the third one automatically.
For Scenario 2 I added:
grid.PerformAction(UltraGridAction.NextRowByTab) grid.Selected.Rows.Clear()e.Cancel = True
after:
grid.PerformAction(UltraGridAction.CommitRow
in your supplied code, then it acts like hitting the enter key.