Question

I'm getting realy frustrated to how to validate a decimal in a TextEditSettings in a GridControl in WPF.

I have a class with a propriety:

public decimal Price { get; set; }

And a grid control with a column that have a EditTextSettings.

I want that the user can input a price with a comma or dot delimiter (12, 1.3, 32,54, 12.00, ecc) but the internal converter parse the comma and other things based on the current culture and for example 12,00 became 12.00 and 12.00 became 1200!

I tried using the Validate event but i can only validate if the number is correct but after the editor convert it with the it's internal converter.

I want simply this beahviour:

  1. User put a number in the editor
  2. The program validate if is a correct decimal (comma or dot delimiter)
  3. If correct update the price valute to the new one and show in the grid the value with ##.## mask
  4. If is wrong return to 0.00 as price.

On DevExpress help center i can't understand their examples. Are all differents.

Thank you in advance.

Was it helpful?

Solution

We have a grid control with the following properties for the EditSettings:

Mask="n" MaskType="Numeric" MaskUseAsDisplayFormat="True" 

Maybe it will help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top