I am using UltraGrid for a data entry form as most of the KeyPunching guys demands that enter key must act like TAB key. I tried to achieve it with the help of following article. But still enter key is getting the cursor next column of the next row instead of next column of the same row, 2ndly at last column it must go to the next row, either to enter new record or on existing record for editing. I hope you got my point.
Thanks for all previous supports.
Regards AHK
I'm not that experienced with the keymapping part of the control since I haven't had the need for it yet, but wouldn't a command like this work:
ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Enter, UltraGridAction.NextCell, 0, UltraGridState.Cell, Infragistics.Win.SpecialKeys.All, 0));
When I placed this code into the load event of the form my enter key worked just like the tab key, so maybe it'll work for you too!
I've got the same problem too..
I've remove the keys.Enter mapping, and add new mapping for keys.Enter, but still not work.
Can you give me the code how to remove or replacing the keys.Enter so it's act like key.Tab
Thanks
Okay, so what's happening there is that the focus is on a TemplateAddRow and pressing enter commits the changes to the row and starts a new TemplateAddRow. This is caused by the KeyActionMappins that already exist in the grid for the Return key with an action of CommitRow. So what you probably want to do is either remove these KeyActionMappings from the collection, or maybe change it so that it requires a special key like CTRL, so the user can commit the changes user CTRL+Enter.
You can reproduce the same like this,
Create one UltraDataSource with few cols, drop one UltraGrid and do one change ....
Basic Setting -> Feature Picker -> Updating -> AllowRowAdding - > AllowAtBottomOfGrid
{
ultraGrid2.DataSource = ultraDataSource1;
MakeEnterActLikeTab(ultraGrid2);
}
Grid.KeyActionMappings.Add(newKam);
RESULT : If you are on 1st col and put some value there and hit the enter key, ultragrid will take you at the 2nd col of the 2nd row.
Please help me out to resolve this issue.
Hi,
I tested this out the KB article code in a simple grid and it works fine for me. There must be somthing else in your code that is interfering. Maybe you are handling a Key event of the grid like KeyDown, KeyPress, or KeyUp. Maybe it's BeforePerformAction? Maybe you are setting TabStop to CellActivation on some of the columns so that they do not allow tabbing.