Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
UltraGridCell Formatting in vb.net
posted

I am trying to get the cell to format. The requirement is the application needs to be able to handle different types of formats. The formats will come from a database so the cells are going to built dynamically. No matter what formatting I use, it always comes out as an integer. I reviewed Microsoft's documentation on numeric formatting, but with no luck.

I want options for formatting for currency, decimal with two digits after the period, integer, and percent. 

Here is my code that builds a UltraNumericEditor

Case DataType.TextType

Dim une As UltraNumericEditor = New UltraNumericEditor

With une
.Nullable = True
.MaskDisplayMode = UltraWinMaskedEdit.MaskMode.Raw
.MinValue = oParam.MinValue
.MaxValue = oParam.MaxValue
End With

'Assign it to the Cell.Editor
With uRow
.Cells(oParam.DisplayName).EditorComponent = une
End With
uRow.Cells(oParam.DisplayName).Column.Format =  "###.##" ' "#####"  "##%" 
uRow.Cells(oParam.DisplayName).Tag = _paramTypeList.Find(Function(en) en.ParameterID = oParam.ID And en.Seq = ugParameters.Rows.Count)