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
Like Mike wrote you are under the TemplateAddRow and the ENTER key try to commit the changes, so you can use the code from tbetts1982 to change the ENTER map key
To make enter key act like tab
i used the following code:
Public Sub MakeEnterActLikeTab(ByVal Grid As Infragistics.Win.UltraWinGrid.UltraGrid) Dim newKam As Infragistics.Win.UltraWinGrid.GridKeyActionMapping For Each ugkam As Infragistics.Win.UltraWinGrid.GridKeyActionMapping In Grid.KeyActionMappings If ugkam.KeyCode = Keys.Tab Then newKam = New Infragistics.Win.UltraWinGrid.GridKeyActionMapping(Keys.Enter, ugkam.ActionCode, ugkam.StateDisallowed, ugkam.StateRequired, ugkam.SpecialKeysDisallowed, ugkam.SpecialKeysRequired) Grid.KeyActionMappings.Add(newKam) End If Next End Sub
and on lastcell of the grid when i press enter key it should move to next control (NextControlOnLastCell) ?
can you give sample code for this?
Wowww..great
it's work.. thank you very much.
have a nice day
Alright, hopefully with this suggestion it works. I'm the type that can't sleep if I find something challenging. I used a TemplateOnBottom. Here's what I came up with:
{
ugKam.Dispose();
}
ultraGrid1.PerformAction(UltraGridAction.NextCellByTab);
else
--This place seriously needs some code tags. Infragistics, you made my grid sexy, now make the forum sexy. :P
Still not work, Keys.Enter not work like Keys.Tab on TemplateAddRow
the cell move to the new row when i press Enter key on TemplateAddRow