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.

Display values with different currency symbols in a column.

Thread ID:

Created:

Updated:

Platform:

Replies:

68554 Sep 24,2007 10:52 PM Sep 25,2007 01:29 AM Windows Forms 1
loading
Tags: GridControl
Alex
Asked On September 24, 2007 10:52 PM

Hi,

Is there a way for different currency symbol to be displayed in a single column?

Currently, I am using a DataView as the DataSource of the a GridDataBoundGrid. The records consist of different values in $, £ and ¥.

If I set its GridBoundColumn.StyleInfo.CellType to 'Currency', it only managed to display those records in which are in $.

By changing the GridBoundColumn.StyleInfo.CellType to TextBox, all records are displayed with it's own currency symbols.
However, CurrencyEdit styles can no longer apply to the cells and the sorting doesn't work properly due to the currency symbol.

Thanks in advance.

Jeba S [Syncfusion]
Replied On September 25, 2007 01:29 AM

Hi Alex,

Thank you for posting query to us.

You can achieve different currency symbol in a single column by handling the PrepareViewStyleInfo. In the event handler check the respective currency column and the RowIndex and set the Style.CurrencyEdit.CurrencySymbol property.

Please refer this code snippets:

private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if(e.ColIndex==3 && e.RowIndex==1)
{
e.Style.CellType="Currency";
e.Style.CellValueType=typeof(double);
e.Style.CurrencyEdit.CurrencySymbol="$";
}
if (e.ColIndex == 3 && e.RowIndex == 2)
{
e.Style.CellType = "Currency";
e.Style.CellValueType = typeof(double);
e.Style.CurrencyEdit.CurrencySymbol = "£";
}
if (e.ColIndex == 3 && e.RowIndex == 3)
{
e.Style.CellType = "Currency";
e.Style.CellValueType = typeof(double);
e.Style.CurrencyEdit.CurrencySymbol = "¥";
}
}

Please refer the sample which illustrates the above said feature:
http://websamples.syncfusion.com/samples/Grid.Windows/F68554/main.htm

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.


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.

;