This is a migrated thread and some comments may be shown as answers.
Grid columns for decimal (18,0) displaying as (16,2)
1 Answer 22 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jamy
Top achievements
Rank 1
Jamy asked on 08 Dec 2010, 12:31 AM
I am using server binding for a bound grid column.

The data type sent in from my edmx is decimal with 18 precision and 0 scale.

If I pull directly from the entity object using linq and pass to the view using the ViewDate object it displays correctly (or basically the way I would expect with no decimal places or point).

When bind to a grid column it displays the number with .00 after it.

Is there anyway to keep this from happening? Preferrably without having to make a custom ViewModel for all of my entity data and relationships because I am using nested grids, tabs, etc. as I am using linq queries for the relationships between my entities.

HELP

1 Answer, 1 is accepted

Sort by
0
Jamy
Top achievements
Rank 1
answered on 08 Dec 2010, 04:58 PM
I was a little confused... Have not used a lot of format specifiers before.

The believe the following code is the proper way.
 
.Format("{0:F0}")
Tags
Grid
Asked by
Jamy
Top achievements
Rank 1
Answers by
Jamy
Top achievements
Rank 1
Share this question
or