We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

NumericTextBox comma separator in grid does not work

Greetings.
I have a grid with numericTextBox as an editor. I have the requirement for comma to be a separator between the whole and fractional parts (instead of a dot). The groupSeparator parameter is supposed to do exactly that, as i understand. In the 'edit' mode of the numericTextBox it works perfectly, and i can input any value I want with comma as a separator. However, when i snap out of edit mode, the field value becomes, as the comma does not exist. As an example, the 2,87 becomes 287.

The code for the grid is the following (some columns deleted for better view):
[dataSource]="syncJobs"
[allowSorting]="true"
[allowSelection]="true"
[allowPaging]="true"
[selectionType]="single"
[allowTextWrap]="true"
[allowResizing]="true"
[editSettings]="{'allowEditing':'true', 'editMode':'batch', 'showConfirmDialog':false}"
[contextMenuSettings]="{enableContextMenu: true, contextMenuItems:[], customContextMenuItems: [{id:'del', text:'Удалить запись'}]}"
(cellSave)="saveRecord($event)"
(queryCellInfo)="cellFormat($event)"
(contextClick)="contextMenuActions($event)"
(contextOpen)="contextMenuActions($event)">

1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team March 13, 2017 12:00 PM UTC

Hi Alex, 

Thanks for contacting Syncfusion support. 

If you need comma to be a separator for the fractional parts, use locale API of ejGrid. In locale API set “de-DE” to get the comma as a separator for the numbers.  

Find the code example: 


<ej-grid [allowPaging]="true" [allowSorting]="true" [dataSource]="gridData" [columns]="columns" [editSettings]="{'allowEditing':'true', 'editMode':'batch'}" [toolbarSettings]= "tool" locale= "de-DE"> 
<e-columns> 
        <e-column field="OrderID" headerText="Order ID" [isPrimaryKey]="true" width="75" textAlign="right" ></e-column>        
        <e-column field="Freight" headerText="Freight" width="75" textAlign="right" format="{0:C}"></e-column> 
        ------------------------------ 
</ej-grid> 
 
----------------------------------------------- 
<script src="vendor/ej.angular2.js"></script> 
<script src="vendor/ej.culture.de-DE.min.js"></script> 


Note: To get the particular culture we need to refer the  “ej.culture.de-DE.min.js” script file in the sample.  

Script Location: C:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.37\JavaScript\assets\scripts\i18n 
Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon