Hi,
I need to have a cell that will accept any input until it starts with A letter. If it starts with A letter the cell should remain in edit mode but any user input should not be written to the cell. That means the cell should have its value equal to A, be in edit mode and disregard all user character keyboard actions.
Is there a simple way I can achieve this?
Thanks,
Vitaly
You can handle the key events and check to see if the input starts with 'A'. If so, cancel keyboard input, otherwise accept keyboard input.
The event you want to look at is CellChange event. If this does not do what you want you can consider using the KeyDown or KeyPress event of the grid. However you will need to check if the ActiveCell is currently in Edit Mode before you process the key.
Well, that can be done using SelStart, SetLength and SelText properties.