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

numericedit right alligned?

Hi,
is it possible to make the value in a numericedit (NumericTextBox) of a dataGrid right aligned?

I want to configure for decimals a right aligned numeric edit field without spin buttons.

{
field: 'Freight',
headerText: 'Freight',
textAlign: 'Right',
format: 'C3',
width: 90,
editType: 'numericedit',
edit: { params: { decimals: 4, showSpinButton:false, validateDecimalOnType:true, textAlign: 'Right'} },
}

The value in the editor is still left aligned.

Kind regards,
michael




5 Replies

PS Pavithra Subramaniyam Syncfusion Team October 1, 2019 05:09 AM UTC

Hi Michael, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by adding the “cssClass” property for the NumericTextBox component. Please refer to the below code example and documentation link for more information. 
 
 { 
    field: 'Freight', 
    headerText: 'Freight', 
    textAlign: 'Right', 
    format: 'C3', 
    width: 190, 
    editType: 'numericedit', 
    edit: { params: { decimals: 4, showSpinButton:false, validateDecimalOnType:truecssClass: 'numericalign'} }, 
}, 
 
 
[Style] 
 .numericalign .e-numerictextbox{ 
        text-align:right; 
  } 
 
 
 
Regards, 
Pavithra S. 



MK Michael Kornatzki October 1, 2019 05:26 AM UTC

Thank you, this works.


PS Pavithra Subramaniyam Syncfusion Team October 1, 2019 07:36 AM UTC

Hi Michael, 
 
Thanks for your update. 
 
We are glad to know that the provided solution helped you. 
 
Please get back to us if you need any assistance on this. 
 
Regards, 
Pavithra S. 



PR pradeep replied to Pavithra Subramaniyam October 3, 2019 10:40 AM UTC

Hi Michael, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by adding the “cssClass” property for the NumericTextBox component. Please refer to the below code example and documentation link for more information. 
 
 { 
    field: 'Freight', 
    headerText: 'Freight', 
    textAlign: 'Right', 
    format: 'C3', 
    width: 190, 
    editType: 'numericedit', 
    edit: { params: { decimals: 4, showSpinButton:false, validateDecimalOnType:truecssClass: 'numericalign'} }, 
}, 
 
 
[Style] 
 .numericalign .e-numerictextbox{ 
        text-align:right; 
  } 
 
 
 
Regards, 
Pavithra S. 


not work


PS Pavithra Subramaniyam Syncfusion Team October 3, 2019 10:59 AM UTC

Hi pradeep, 
 
For validating your query we need some more details from your end. Could you please provide the below details that will be helpful for better understanding and provide solution as early as possible. 
 
  1. Share your code example.
  2. Share the customized style for numeric text box
  3. Share the Syncfusion Package version you are using.
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon