[DevExpress Support Team: CLONED FROM T352836: Custom Decimal Property Editor not invoked when Currency value is changed]
How to set the AspxTextBox editors mask property based on a culture. I tried as below,
C#DecimalPropertyEditor.MaskSettings.Mask = String.Format("{0}<0..99999g>.<{1}..{2}>", CurrentCulture.NumberFormat.CurrencySymbol, new String('0', CurrentCulture.NumberFormat.CurrencyDecimalDigits), new String('9', CurrentCulture.NumberFormat.CurrencyDecimalDigits));
But it uses only DecimalDigits and Currency Symbol and thus incomplete. I would like to mask the input entirely based on the selected culture(Culture can be selected from the drop down) as I did in the Winforms solution using the below code, so that the windows solution and win solution is in synch
C#DecimalProperty.Mask.Culture = CultureInfo.GetCultureInfo(Currency.Culture.CultureID);
//To format the currency and numeric fields based on the number format designed for the culture chosen
DecimalProperty.DisplayFormat.Format = DecimalProperty.Mask.Culture.NumberFormat;
Is it possible?
Thanks
Hello Kanagu,
Our ASPxTextBox' mask automatically gets the page's or project's culture. So, it is not necessary to set the currency symbol on every request to mask settings. You can set the "$" sign and it will be changed to the required one based on the value of the current culture. As for the thousand separator, it's added based on the current culture as well. Please refer to the Mask Types documentation article to learn more about mask settings in ASP.NET.
I've created a sample web site to demonstrate how our ASPxTextBox operates with your mask. Please review it. If it doesn't meet your requirements, please describe your scenario in greater detail. It will be helpful if you provide me with a screencast (you can create it with the Jing tool) illustrating how the text box should operate with a mask.
I'll do my best to find a precise solution.
Hello Lex,
Thank you for the video. I have attached a video and a sample program describing what I am trying to achieve.
As you see in the win application, I can successfully format and save the 2 amount fields based on selected culture and Home culture respectively. But I am unable to achieve the same in web solution ,as it looks like ,AspXTextBox doesnt provide any option for specifying the culture based on which the amount field should be formatted.It by default takes the culture of the currently executing thread. I cant set the culture of the thread to the SelectedCulture as there are two fields in a same page and each one should be formatted based on two different cultures.
Hope the question is clear . Please let me know if you need more details.
The Video
And the solution
Hello Kanagu,
Thank you for the sample project and video file. I am working on this issue and need additional time to complete the research. I will notify you once I get results. I appreciate your patience.