Hi Raymond,
Please refer this link :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp
( # - Note that this specifier never displays the ''0'' character if it is not a significant digit, even if ''0'' is the only digit in the string.)
You could set e.Style.Format=''0'' or try handling the QueryCellFormattedtext and refer this code snippet and let us know if this helps.
private void Form1_Load(object sender, System.EventArgs e)
{
this.gridControl1[3,3].CellValueType = typeof(double);
this.gridControl1[3,3].CellValue = 0.0;
this.gridControl1[3,3].Format = "#";
}
private void gridControl1_QueryCellFormattedText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e)
{
if(e.Style.CellValueType == typeof(double))
{
double val;
val = (double)e.Style.CellValue;
e.Text =val.ToString();
e.Handled = true;
}
}
Here is a sample.
format.zip
Best Regards,
Jeba.