I'm using embended masked edit in WinGrid.
What I dislike is numbers ++/-- functionality when using up/down arrow keys.
I've tried to disable this option as presented below, but this doesnt work to me.
Any idea what I'm doing wrong... ?
// Construct & setup editor UltraMaskedEdit mtEdit = new UltraMaskedEdit(); // Common settings mtEdit.Visible = false; mtEdit.InputMask = inputMask; mtEdit.Nullable = false; mtEdit.PromptChar = ' '; column.Nullable = Infragistics.Win.UltraWinGrid.Nullable.Nothing; // Remove up/down arrow key action for (int i = mtEdit.KeyActionMappings.Count -1; i>=0; i--) { KeyActionMappingBase kam = mtEdit.KeyActionMappings[i]; MaskedEditAction action = (MaskedEditAction)kam.ActionCode; Console.WriteLine(action); switch (action) { case MaskedEditAction.DownKeyAction: case MaskedEditAction.UpKeyAction: mtEdit.KeyActionMappings.Remove(i); break; } } // Finally Marge with grid ultGrid.DisplayLayout.Bands[0].Columns[sourceColumn].EditorControl = mtEdit;
I tried this and it worked:
UltraGridColumn column = this.ultraGrid.DisplayLayout.Bands[0].Columns["whatever"];EditorWithMask editorWithMask = new EditorWithMask();column.Editor = editorWithMask;for ( int i = editorWithMask.KeyActionMappings.Count - 1; i >= 0; i-- ){ KeyActionMappingBase km = editorWithMask.KeyActionMappings[i]; if ( km.KeyCode == Keys.Up || km.KeyCode == Keys.Down ) editorWithMask.KeyActionMappings.Remove( km );}
Thanks for tip, but how can I setup input mask for this type of editor
(I couldn't find inputMask property for it)
I'm interested to allow entering only positive numbers here with 2 dec places
EDIT: OK I found I need use grid cell's inputMask propertry for that.
Thanks!