Hi,
On a WebDataGrid, I have a BoundDataField of type DECIMAL,
When I want to edit throught cell editing core :
Example 1 : for the number 832,47 it show 83247 (decimal 47 isn't anymore)
Example 2 : for the number 2148,67 it show 2148,670000000000073 (decimal 67 stay, it's ok)
The data is defined on sql database as decimal(11,2)
Here you are the code :
<ig:BoundDataField DataFieldName="MONSAL" Key="MONSAL" DataType="System.Decimal" DataFormatString="{0:N2}"> <Header Text="MONSAL" /> ig:BoundDataField>
Note : I try to set up the right DataFormatString following the Standard Numeric Format Strings ==> http://msdn.microsoft.com/en-us/library/0c899ak8.aspx but I don't know which one I have to take in order to display "0,00" format.
Kind Regards.
Hello Frederic,What you are facing is the expected behavior. The grid is applying those formats only when it is rendered. When in edit mode it is showing the real value which means that if your fractional part is 0 it will show you only the number without the “.00”. If your fraction part is “0.3434343” in edit mode you will see all the 7 digits after the “.”. If you want to have formatting in edit mode you will have to set editor provider to this column and set formatting to this provider.
Hello,
Many thanks for the answer.
I've created a numericEditorProvider
<ig:NumericEditorProvider ID="WebDataGrid1_NumericEditorProvider1"> <EditorControl ClientIDMode="Predictable" DataMode="Decimal" > </EditorControl> </ig:NumericEditorProvider>
and set this editor to the column
<ig:EditingColumnSetting ColumnKey="MONIMP" EditorID="WebDataGrid1_NumericEditorProvider1" />
Unfortunately, it doesn't work..
In order to have 2 decimal, what shall I do exactly ?
see image
Hi fdevalck,
In the EditorControl of the EditorProvider, try settting (I think) EditFormat. This will control how the data will appear while editing I believe.
regards,
David Young
Sorry but there are no EditFormat propeties... I've already put Datamode="Decimal" instead..
Kind Regards