The sample application you sent works and works great. I also tried using the UltraNumericEditor object and set the cell's editor component to the new editor. I thought that might change the something, but the formatting does not work. It always comes out as an integer. I tried changing the NumerType to Decimal/Double. The same thing happens, always comes out as an Integer. I thought the editor at some might change, but when I set the property, MASKINPUT, the mask does generate, and the format does change, but there are no literals when I set up the format to have the '$' sign. In the InitializeLayout event function, I am looking at a list of objects and the function determines what type of cell needs to be created (date/text/dropdown/number) for that particular column. When I create an UltraDateEditor, the format that I set comes out correctly, but not the UltraNumeric Editor.
For Each oParam As Parameter In _parameters
Select Case oParam.DataType
Case DataType.DateType
Dim udte As New UltraDateTimeEditor
uRow.Cells(oParam.DisplayName).EditorComponent = udte
udte.Value = uRow.Cells(oParam.DisplayName).Value
udte.FormatString = oParam.FormatValue
If oParam.MinValue IsNot Nothing Then
udte.MinDate = oParam.MinValue
End If
If oParam.MaxValue IsNot Nothing Then
udte.MaxDate = oParam.MaxValue
End If
uRow.Cells(oParam.DisplayName).Column.Style = ColumnStyle.DateTimeWithoutDropDown
uRow.Cells(oParam.DisplayName).Tag = _paramTypeList.Find(Function(en) en.ParameterID = oParam.ID And en.Seq = ugParameters.Rows.Count)
Case DataType.Dropdown
Dim vList As ValueList = New ValueList()
Dim strNArray() As String
Dim strVArray() As String
Dim strSQL As String = ""
vList.ValueListItems.Add("", "")
strSQL = oParam.ItemSQL
If strSQL <> "" Then
Dim strName = oParam.ItemNames
Dim strValue = oParam.ItemValues
Dim results As DataSet = loadItemsFromDB(strSQL)
If results IsNot Nothing Then
For Each oRow As DataRow In results.Tables(0).Rows
vList.ValueListItems.Add(oRow.Item(strValue), oRow.Item(strName))
Next
End If
Else
strNArray = oParam.ItemNames.Split(",")
strVArray = oParam.ItemValues.Split(",")
Dim idx As Integer
If strNArray.Count = strVArray.Count Then
For idx = 0 To strNArray.Count – 1
vList.ValueListItems.Add(strVArray(idx), strNArray(idx))
Next
End If
End If
uRow.Cells(oParam.DisplayName).ValueList = vList
Dim t As ParamType = _paramTypeList.Find(Function(en) en.ParameterID = oParam.ID And en.Seq = ugParameters.Rows.Count)
uRow.Cells(oParam.DisplayName).Tag = t
uRow.Cells(oParam.DisplayName).Style = ColumnStyle.DropDownValidate
Case DataType.Number
Dim une As New UltraNumericEditor
uRow.Cells(oParam.DisplayName).EditorComponent = une
une.MinValue = oParam.MinValue
une.MaxValue = oParam.MaxValue
une.NumericType = NumericType.Integer
une.FormatString = oParam.FormatValue
une.MaskDisplayMode = UltraWinMaskedEdit.MaskMode.IncludeLiterals
une.MaskInput = oParam.FormatValue
une.Nullable = True
uRow.Cells(oParam.DisplayName).Tag = _paramTypeList.Find(Function(en) en.ParameterID = oParam.ID And en.Seq = ugParameters.Rows.Count)
Case DataType.TextType
uRow.Cells(oParam.DisplayName).Tag = _paramTypeList.Find(Function(en) en.ParameterID = oParam.ID And en.Seq = ugParameters.Rows.Count)
End Select
Next
Why does the Date Cell format correctly and the Numeric Cell Format does not? Maybe I am missing something?
Maybe there is a better place to create the cells?