We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

culture dependent number formatting

Hi... I'm having trouble with the number formatting.

I want to display the number formatting with decimal and group separators defined in the current culture (System.Globalization.CultureInfo)

- the next code does nothing :
gridGroupingControl1.Culture = System.Globalization.CultureInfo.CurrentCulture;

the current culture is Croatian, and it seems that grid sets it's culture accordingly, but the number format remains unchanged.

How can I make it work?
I've attached a sample for you to modify.

thanks.

TestCulture.zip

3 Replies

HA haneefm Syncfusion Team June 5, 2007 05:21 PM UTC

Hi Vicko,

You can try these code in a form's load event.

gridGroupingControl1.TableDescriptor.Appearance.AnyCell.Format = "C";
gridGroupingControl1.TableDescriptor.Appearance.AnyCell.CultureInfo = System.Globalization.CultureInfo.CurrentCulture; //new System.Globalization.CultureInfo("cs-CZ");

Best regards,
Haneef


VH Vicko Hazdovac June 6, 2007 09:54 AM UTC

this works fine, thank you
I just have one more question.

I don't want the user to be able to see the currency. I've tried using

CultureInfo cI = System.Globalization.CultureInfo.CurrentCulture;

cI.NumberFormat.CurrencySymbol = "";

but it's a read only property. Is there another way I can hide the currency symbol in the cells?

(I've seen that there is a CurrencyEdit property in the cell but I don't know actually how to use it)

thanks in advance


HA haneefm Syncfusion Team June 6, 2007 05:59 PM UTC

Hi Vicko,

The CurrenyCells( \Syncfusion\EssentialStudio\5.1.1.0\Windows\Grid.Windows\Samples\2.0\CellTypes\CurrencyCells\ ) browser sample will illustrate how you can use Syncfusion’s CurrencyEdit control in grid cells. The various options that are present will allow you to set the patterns which, are used to display positive and negative numbers, groupings, decimal separators and more. In addition, this sample will allow you to display an event log which, will show the order of the currentcell events that are raised and the values that are in the cell as the events occur. You will be able to see mouse events as well.

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon