Originally Posted 15 March 2017, 10:43 am ESTI'm using a FlexGrid, and have a couple of cell validation issues I can't work out.
Invalid value selection
In the ValidateEdit event, I can validate the value, and use e.Cancel if it's invalid. This works fine.
However, this leaves the cursor at the position the user stopped typing.
I find that I then try to type in a correct value, but this simply adds further characters to the value in the cell.
Is it possible to highlight/select all the text in a cell if the validation fails?
Set Value on validation fail
Is it possible to set the value if the validation fails?
For example, I have a FlexGrid with float (Single) values. The upper limit is 50.
If the user enters 100, I want to show an error message using a MessageBox, and then set the value to the maximum value.
This obviously mustn't happen in the ValidateEdit event, so where should it happen?