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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unbound Appearance (Currency format)

Thread ID:





106982 Feb 5,2013 07:27 PM UTC Feb 20,2013 05:45 AM UTC ASP.NET Web Forms (Classic) 5
Tags: GridGroupingControl
Dale Norhern
Asked On February 5, 2013 07:27 PM UTC



I have a GridGroupingControl that is data bound to an asp:SqlDataSource.  I also have unbound columns that whose values are calculated in the code behind.  The grid is populated, and the calculated values all work as expected.  However, I cannot get the unbound cells to accept any formatting.  I have tried multiple methods, from modifying the appearance tag in the markup to setting properties on load or load complete and even setting explicit values on QueryCellStyleInfo.  Here is the aspx code I am using:



                            <RecordFieldCell CellType="Currency" WrapText="False" CellValueType="System.Double"




What is interesting is if I place this exact same code on one of the bound columns, it formats perfectly?!?!?  I think the problem may be similar to the post here: http://www.syncfusion.com/support/forums/grid-windows/33912 from 2005.  Also of interest, I can set the color in the <Appearance> section and it gets applied (while the Currency formatting does not).


I need a method for showing a currency format for an unbound column in a GridGroupingControl.


Visual Studio 2010

.NET Framework 4.0

Essential Studio

VB.Net Code behind






Ranjithkumar R G [Syncfusion]
Replied On February 11, 2013 11:15 AM UTC

Hi Dale,


Thanks for using Syncfusion products.


We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample and the same can be downloaded from the following links. 

Sample link:  sample-2.zip 

Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.


Please let us know if you have any concerns.




Dale Norhern
Replied On February 12, 2013 04:03 PM UTC



Thank you again for your very thorough response and sample.  The sample you supplied did NOT exhibit my problem.  It also did NOT match my requirements, however.  I have modified the sample to illustrate my issue (see the attachment sample-21166577707.rar).


Here is a list of the changes made from your sample.


Northwind database replaced with an older version to match my SQL Express version (no effect to the sample).

The function GetData() was commented out.

A new column was added (TestCurrency).

this.ggc.TableDescriptor.Columns[4].Appearance.AnyRecordFieldCell.Format = "$###.##"; was added to format the TestCurrency format to be currency.

<RecordFieldCell CellType="Currency" CellValueType="System.Double" Format="C" /> was added to the TestCurrency markup.

public void GridGroupingControl1_RowDataBound(object sender, RowDataBoundEventArgs e) was added to populate the TestCurrency cells as the table was loaded.

SqlDataSource1 was added as the table data source (to match my requirements).

Unused variables were commented out.


The screenshot (Unformatted.JPG in the attachment) shows that the formatting for the TestCurrency column is not applied.  I need this unbound calculated column to honor its formatting.




Ranjithkumar R G [Syncfusion]
Replied On February 13, 2013 07:04 AM UTC

Hi Dale,

Thanks for your update.

We have analyzed your sample. In that we found you have cast the type ‘double’ to ‘string ’ to make a column in Grid and so the format ‘Currency’ does not getting apply for that column alone. We have added two columns with specifying the ‘Format’ as ‘C’ to make it work for integer columns.  Please let us know if you receive the error in ‘double’ datatype column in Grid.

Please let us know if you have any concern.



Dale Norhern
Replied On February 13, 2013 10:17 PM UTC



"we found you have cast the type ‘double’ to ‘string '" This is part of my problem.  From within the RowDataBound event I cannot find a method to set the cell value.  I expected a function like (e.Row.Cells[4].Value) but the only option is (e.Row.Cells[4].text).  I've tried many aproaches, but there are none that seem to work.


Was there supposed to be a sample attachment?  If so, it didn't come through.





Ranjithkumar R G [Syncfusion]
Replied On February 20, 2013 05:45 AM UTC

Hi Dale,


Sorry for the delay in getting back to you.


We suggest you to set the format of currency as illustrated below in RowDataBound event.


 public void GridGroupingControl1_RowDataBound(object sender, RowDataBoundEventArgs e)


        if (e.Row != null)


            if (e.Row.DisplayElement.Kind == DisplayElementKind.Record)


                double nTest = 0.0;

                nTest = Convert.ToInt32(e.Row.Record.GetSourceIndex()) + 1;

                double nPi = nTest * Math.PI;

                e.Row.Cells[4].Text = string.Format("{0:C}", nPi);                







Please let us know if you have any concern.





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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon