Hi,
I have in my WedDataGrid several quantities with different units of measurement per line. how do I format it my cells
Row Article Quantity Unit Number of Decimal
1 Article1 15 PC 0
2 Article2 15,190 KG 3
Thanks,
Hello David,The easiest way to do that is through Designer. Go to “Edit Columns” -> Select field -> Go to “DataFormatString”
Or you can set it in the markup:
<ig:BoundDataField DataFieldName="UnitPrice" DataFormatString="{0:C}" Key="UnitPrice"> <Header Text="UnitPrice" /> </ig:BoundDataField>
Please let me know if you need additional assistance.
Sorry if I misspoke.I want to format the number of digits of my values. It changes depending on the unit used. I have a field 'TQDecim' containing the number of decimal places to display and capture.Example:Peace unit : 0 decimalKg: 3 decimals
Ok David,Then you have to use other DataFormatString. For example if you have value 1.2345: <ig:BoundDataField DataFieldName=" Kg" DataFormatString="{0:0.000}" Key=" Kg"> <Header Text=" Kg" /> </ig:BoundDataField>
This will display 3 digits after decimal sign: 1.234or <ig:BoundDataField DataFieldName=" Peace unit" DataFormatString="{0:0.}" Key=" Peace unit"> <Header Text=" KgPeace unit/> </ig:BoundDataField>
This will not display any digits after decimal sign: 1
Please let me know if have any additional questions with this matter.
Hello David,
If you want different number of decimals you may use the InitializeRow event to round your cell value depending on the value of the next cell.
Please refer to the below forum thread discussing the same topic.
https://es.infragistics.com/community/forums/f/retired-products-and-controls/48205/different-inputmask-for-each-row
Let us know if you need further assistance regarding this.
Thank you