JJ 13.10.15 - fix datepicker

This commit is contained in:
JenneJ
2015-10-13 15:43:53 +02:00
parent c74e5434b9
commit a90237f7a1
2 changed files with 8 additions and 4 deletions

View File

@@ -901,6 +901,8 @@ Public Class ClassControlBuilder
control.TabIndex = tabindex
control.TabStop = tabstop
control.Parent = _master_panel
control.Properties.NullDate = DateTime.MinValue
control.Properties.NullText = String.Empty
If _new And IsNothing(parent) Then
control.Location = Me.GetCursorPosition()

View File

@@ -76,11 +76,13 @@ Public Class ClassControlValues
Dim combobox As ComboBox = DirectCast(control, ComboBox)
combobox.SelectedIndex = combobox.FindStringExact(result)
Case 4 'DateTimePicker
If result = "" Then
result = Now
End If
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
datepicker.DateTime = Date.Parse(result)
If result = "" Or result = "00:00:00" Then
datepicker.DateTime = DateTime.MinValue
Else
datepicker.DateTime = Date.Parse(result)
End If
Case 13 ' Listbox
Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(control, DevExpress.XtraEditors.ListBoxControl)
listbox.SelectedIndex = listbox.FindStringExact(result)