Make DisplayFormat configurable for TextBoxes and GridColumns, Fix Typo, Properly Convert Dates and Numbers in Vector Fields
This commit is contained in:
@@ -210,6 +210,39 @@ Public Module ModuleControlProperties
|
||||
<Category(ClassConstants.CAT_VALIDATION)>
|
||||
<Editor(GetType(MultilineStringEditor), GetType(UITypeEditor))>
|
||||
Public Property RegexMessage As String
|
||||
|
||||
<DisplayName("Display Format String")>
|
||||
<Category(ClassConstants.CAT_DISPLAY)>
|
||||
<TypeConverter(GetType(DisplayFormatConverter))>
|
||||
Public Property DisplayFormat As String
|
||||
|
||||
Public Class DisplayFormatConverter
|
||||
Inherits TypeConverter
|
||||
|
||||
Public Overrides Function GetStandardValuesSupported(context As ITypeDescriptorContext) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function GetStandardValues(context As ITypeDescriptorContext) As StandardValuesCollection
|
||||
Dim displayFormatList = New List(Of String) From {
|
||||
ClassControlCreator.CONTROL_TYPE_TEXT,
|
||||
ClassControlCreator.CONTROL_TYPE_BOOLEAN,
|
||||
ClassControlCreator.CONTROL_TYPE_INTEGER,
|
||||
ClassControlCreator.CONTROL_TYPE_DOUBLE,
|
||||
ClassControlCreator.CONTROL_TYPE_CURRENCY
|
||||
}
|
||||
Dim values As New StandardValuesCollection(displayFormatList)
|
||||
Return values
|
||||
End Function
|
||||
|
||||
Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object
|
||||
If IsNothing(value) Then
|
||||
Return ""
|
||||
Else
|
||||
Return value.ToString()
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Class LabelProperties
|
||||
|
||||
Reference in New Issue
Block a user