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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Editing numeric values with decimals

Thread ID:

Created:

Updated:

Platform:

Replies:

123172 Feb 23,2016 12:42 PM UTC Feb 26,2016 12:51 PM UTC ASP.NET Web Forms 5
loading
Tags: TreeGrid
Jorge Pampin
Asked On February 23, 2016 12:42 PM UTC

Hello,

I configure the numeric values this way:

columnaGrid.NumericEditOptions = new EditorProperties();
columnaGrid.NumericEditOptions.DecimalPlaces = 2;
columnaGrid.NumericEditOptions.Locale = "es-ES";

And, when a cell is edited, the decimal part is truncated: 15,25 -> 15,00.

Thanks!



Mahalakshmi Karthikeyan [Syncfusion]
Replied On February 24, 2016 01:29 PM UTC

Hi Jorge,

Thanks for contacting Syncfusion support.

We can set the decimal places to numeric edit fields in TreeGrid. We need to define decimal places for the numeric field in the following format.

protected void Page_Load(object sender, EventArgs e)

        {

            //…

            var index1 = this.Treegrid.Columns.FindIndex(col => col.Field == "PercentDone");

            this.Treegrid.Columns.ElementAt(index1).NumericEditOptions = new EditorProperties() { DecimalPlaces = 2 };    

}

Also we no need to set locale for separate numeric field as you have done in your code example. Once we set locale to the control it will take to all its fields.

We have also prepared a sample based on this and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/NumericField1556664569

Regards,

Mahalakshmi K.


Jorge Pampin
Replied On February 24, 2016 05:29 PM UTC

Hello,

The TreeGrid control is still truncating the decimals of the values with 'es-ES' localization.

Thanks

Mahalakshmi Karthikeyan [Syncfusion]
Replied On February 25, 2016 10:11 AM UTC

Hi Jorge,

We were not able to reproduce any issue in numeric field when locale applied to the TreeGrid. Please fine the below code example for details.

[ASPX]

<script>

       ej.TreeGrid.Locale["es-ES"] = {

           toolboxTooltipTexts: {

               addTool: "añadir",

               editTool: "editar",

               updateTool: "actualizar",

               deleteTool: "borrar",

               cancelTool: "cancelar",

               expandAllTool: "expandir todo",

               collapseAllTool: "expandir todo",

               pdfExportTool: "exportación a PDF"

           },

       }

   </script>


<ej:treegrid ID="Treegrid" runat="server" Locale="es-ES" //… >

//…

</ej:treegrid>  


[CS]

protected void Page_Load(object sender, EventArgs e)

        {

            //…

            var index1 = this.Treegrid.Columns.FindIndex(col => col.Field == "PercentDone");

            this.Treegrid.Columns.ElementAt(index1).NumericEditOptions = new EditorProperties() { DecimalPlaces = 2 };    

}

We have also prepared a sample based on this and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/NumericFieldWithLocale231505062

If you still facing any issue, please get back to us by modifying this sample along with the replication procedure to reproduce it.

Regards,

Mahalakshmi K.


Jorge Pampin
Replied On February 25, 2016 11:50 AM UTC

Hello,

You need to change this to show the characater ',' as decimal separator:

this.Treegrid.Columns.ElementAt(index1).NumericEditOptions = new EditorProperties() { DecimalPlaces = 2, Locale=this.Treegrid.Locale };

Then, the cell truncates the decimals of the values.

Thanks!

Mahalakshmi Karthikeyan [Syncfusion]
Replied On February 26, 2016 12:51 PM UTC

Hi Jorge,

Sorry for the inconvenience caused.

We were able to reproduce the issue while setting locale to the numeric field in TreeGrid. Hence we have also logged an issue report regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you require further assistance on this.

Regards,

Mahalakshmi K.


CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;