Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
21514 | Nov 12,2004 02:23 PM UTC | Nov 15,2004 05:03 PM UTC | WinForms | 4 |
![]() |
Tags: GridControl |
private void gridControl1_QueryCellFormattedText(object sender, GridCellTextEventArgs e)
{
if(e.Style.CellValueType == typeof(double) && e.Style.Text.Length > 0)
{
double val = float.NaN;
if(e.Style.CellValue is string)
Double.TryParse((string)e.Style.CellValue, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out val);
else
val = (double)e.Style.CellValue;
e.Text = val.ToString("F3", e.Style.CultureInfo);
e.Handled = true;
}
}
Here is a small sample.
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.
This page will automatically be redirected to the sign-in page in 10 seconds.