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.
Unfortunately, activation email could not send to your email. Please try again.

culture dependent number formatting

Thread ID:

Created:

Updated:

Platform:

Replies:

61964 Jun 5,2007 09:39 AM Jun 6,2007 01:59 PM Windows Forms 3
loading
Tags: GridControl
Vicko Hazdovac
Asked On June 5, 2007 09:39 AM

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

haneefm [Syncfusion]
Replied On June 5, 2007 01:21 PM

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

Vicko Hazdovac
Replied On June 6, 2007 05:54 AM

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

haneefm [Syncfusion]
Replied On June 6, 2007 01:59 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;