Is there an easy way to set the decimal place limit on a double in a datagrid?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Only way I can figure it at present is to do some string manipulation so I can catch the '.' and count the chars and cut after a certain point
Does anyone know an easier way to do this? The data is represented in a datagrid so maybe I can somehow cover it there

Many thanks to those that do know the answer and tell me about it (or those that discuss the point, if there is no true answer). :

jax
 
Hi
Only way I can figure it at present is to do some string manipulation so I can catch the '.' and count the chars and cut after a certain point.
Does anyone know an easier way to do this? The data is represented in a datagrid so maybe I can somehow cover it there?

Many thanks to those that do know the answer and tell me about it (or those that discuss the point, if there is no true answer). :)

Look in .NET docs: DataGridTextBoxColumn overview
especially at properties: Format, FormatInfo

There is something like a *TableStyles* in *TrueGrid* properties.
You should set it for your DataTable...
And there is a *GridColumnStyles* in a TableStyle. Those *column styles*
are responsible for formatting of DataTable's columns.

*MappingName* property - represents a table name for "table style",
and a column name for "column style".

I hope it helps...

Marcin
 
Back
Top