Hello,
I'm using the Infragistics.Win.UltraWinGrid.UltraGrid to enable the entry/capture of financial data.
Its quite common to enable the key shortcuts 'M'(/'m') and 'K'(/'k') as quick entry (for 1000000 and 1000 respectively) for entry of monetary / quantity fields. I currently have the UltraDataColumn.DateType of the related ltraDataSource columns set to the Type of System.Double.
When an non numeric character is currently entered the built in validation rejects the value, as expected.
I can't curently identify a way of trapping the cell value before this internal 'DataType' validation occurs, to enable the substitution of zeros when an 'M' or 'K' character is encountered.
Is there any built in support available to translate 'M'(/'m') and 'K'(/'k') to 1000000 and 1000, or a way that I can trap the value before the internal 'DataType' validation occurs?
With thanks in advance.
Hello RFPCymba,
I attached a sample with a possible approach for achieving the desired behavior. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
Thanks Boris,
This is quite an old post.
FYI, the 'solution' I settled for was to use a string datatype in the datasource/grid, and handle the desired K/M substituton and number formatting in the code.
The ability to handle a 'before data type validation' event would however still be a useful enhancement.
Note that there are similar 'solutions' in place for editing cells with datasource/grid datatype=datetime and where the existing cell value in the datasource = null or dbnull. This results in Infragistics exceptions being thrown out of the System.Windows.Forms.Application.Run() method or the System.Windows.Forms.Application.ThreadException event handler if defined.
Regards.
Thank you for contacting us and sharing this information.
Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.
Please do not hesitate to contact us if you need any additional assistance.