User (Old forums)MemberJanuary 12, 2005 at 10:27 amPost count: 23064
I use Grid 2.2 and try to use the Maskviewer but unfortunately it does not display the values as required 🙁 Maybe someone could help me with the correct format? Thanks
This is the code:
Dim maskViewer As New Xceed.Grid.Editors.GridMaskedTextBox
maskViewer.Mask = “0,00”
gridCol = New Xceed.Grid.Column(sColumn, GetType(Double))
gridCol.CellViewer = maskViewer
I tried it with 0 , . % in nearly every combination but it seems that the mask is just <b>added</b> in front of the numbers…? My goal is to have a thousand seperator in the numeric column, e.g.:
(empty if ‘Nothing’)
By the way, I used the german settings which are . for the thousands and , for the decimals, don’t be confused 😉
Any ideas how to achieve this? Thanks!!
Imported from legacy forums. Posted by Kai (had 3793 views)Xceed SupportMemberJanuary 12, 2005 at 12:56 pmPost count: 5658
A mask can be used to edit strings of known fixed number of characters, such as credit card numbers, short date format (mm-dd-yyyy) and phone numbers for one region.
Decimals require variable number of characters therefore a TextBox or a NumericUpDown control should do the job.
You can format and parse your strings using a System.Globalization.NumberFormatInfo instance and methods like Decimal.Parse(), Decimal.ToString( IFormatProvider ).
Imported from legacy forums. Posted by Vince [Xceed] (had 274 views)Xceed SupportMemberJanuary 12, 2005 at 2:35 pmPost count: 5658
In addition to that, I heard from another developper that in the Grid you could use the GridNumericBox as a viewer.
Also you can use a FormatSpecifier on the column or the cell for formatting.
Imported from legacy forums. Posted by Vince [Xceed] (had 344 views)Xceed SupportMemberJanuary 12, 2005 at 2:51 pmPost count: 5658
To show the thousand separator into a numeric column of the Grid it is as simple has setting the correct FormatSpecifier in the Cell or Column. In your case, simply putting “n” in the FormatSpecifier of the column should do the job (That will then format the cell using the thousand separator).
This will work only when viewing the content, not when editing it.
Imported from legacy forums. Posted by Francois (had 348 views)
- You must be logged in to reply to this topic.