I am attempting to add functionality so my users can enter something like 120m and the grid will interpret this as 120,000,000. This is only a data entry feature so the value that should be passed to the underlying source is 120000000. The data type of the column is double. I did this in the UltraNumericEditor by handling the KeyPress event and taking appropriate action. This worked really well. I then set the EditorControl of my column to the numeric editor but it looks like this does not work because the grid (or the windowed control?) is consuming the keypress event. I also thought about using a combination of a mask and a datafilter but this is not ideal because I want the same functionality in the grid and in my numeric editors.
Any ideas?
You could use the KeyPress event of the grid.
Or.. a better solution would probably be to use a DataFilter. Then you could apply the same data filter to any standalone controls as well as to an editor for the grid column.
The problem with the datafilter is that the user would see the m being typed in the cell and I would need to parse out the character. For example if I typed 3.2m the user would see the m and I would need to process the 3.2m as a string. Also, if it is a larger number such as 1,000m I would need to parse out the ',' and the 'm' in the data filter. I do like the functionality when handling the KeyPress event but then the event will fire for every key press in the entire grid. Also, I would need to hand the keyPress for the grid and the keyPress for the editors separetely. Idealy, I would like to use the UltraNumericEditor as the EditorControl of the column but the grid does not pass the KeyPress event down to the control. Is there any way to do this?
Thanks for your response.