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

How to set custom formating for GGC cell.

Thread ID:





77050 Oct 9,2008 09:21 PM UTC Oct 13,2008 12:09 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On October 9, 2008 09:21 PM UTC

How do i format values in specific column. Now am doing some thing like this in QueryCellStyleInfo event

void _gridGroupingControl_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
if (e.TableCellIdentity.Column.Name.Equals("Amount"))
e.Style.CellType = "Currency";

which ends up displaying the values as $2,345.00 or ($2,345.00) if its a negative amount.

What i need is to display the the value as 2,345.00 or -2,345.00 if its a negatiove value.

How can i do this?

Rajadurai C [Syncfusion]
Replied On October 13, 2008 12:09 PM UTC

Hi Deva,

Thanks for your interest in Syncfusion products.

To achieve this feature, you can use the GridStyleInfo.CurrencyEdit properties in QueryCellStyleInfo event handler. Given below is a sample code snippet.

private void gridGroupingControl1_QueryCellStyleInfo(object sender,GridTableCellStyleInfoEventArgs e)
if(e.TableCellIdentity.ColIndex == 4 && e.TableCellIdentity.RowIndex > 1)
e.Style.CellType = "Currency";
e.Style.CurrencyEdit.CurrencySymbol = "";
e.Style.CurrencyEdit.NegativeSign = "-";
e.Style.CurrencyEdit.CurrencyNegativePattern = 1;
e.Style.CurrencyEdit.NegativeColor = Color.Black;

Please check out the sample here.


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