HA
haneefm
Syncfusion Team
October 5, 2007 11:39 PM UTC
Hi steve_randomno,
There are special formatting events that you could use to control the formatting. The events are QueryCellFormattedText and DrawCellDisplayText event. Below are some snippets that show how to customize the formating of the cells in a grid.
private void GridDrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
{
if(e.Style.CellType = "FormulaCell" && e.DisplayText != null && e.DisplayText != string.Empty )
{
double dvalue = Double.Parse(e.Style.CellValue.ToString());
e.DisplayText = String.Format("{0:#,##0,,.0MB}",dvalue) ; //Your Format
}
}
private void GridQueryCellFormattedText(object sender, GridCellTextEventArgs e)
{
if (e.Style.CellType == "FormulaCell" )
{
string s = e.Style.Text;
double dvalue = Double.Parse(e.Style.CellValue.ToString());
e.Text = String.Format("{0:#,##0,,.0MB}",dvalue) ; //Your Format
e.Handled = true;
}
}
Best regards,
Haneef