MS22062016

This commit is contained in:
SchreiberM
2016-06-22 10:52:52 +02:00
parent d71de0dc2f
commit fd8e85146a
17 changed files with 1193 additions and 306 deletions

View File

@@ -235,34 +235,64 @@ Public Class ClassRecordView
Case "Combobox"
DirectCast(control, TextBox).Text = value.ToString()
Case "Datepicker"
DirectCast(control, TextBox).Text = DateTime.Parse(value).ToShortDateString()
Try
DirectCast(control, TextBox).Text = DateTime.Parse(value).ToShortDateString()
Catch ex As Exception
End Try
Case "Checkbox"
DirectCast(control, CheckBox).Checked = Boolean.Parse(value)
Try
DirectCast(control, CheckBox).Checked = Boolean.Parse(value)
Catch ex As Exception
DirectCast(control, CheckBox).Checked = False
End Try
Case "RadioButton"
DirectCast(control, RadioButton).Checked = Boolean.Parse(value)
Try
DirectCast(control, RadioButton).Checked = Boolean.Parse(value)
Catch ex As Exception
DirectCast(control, RadioButton).Checked = False
End Try
Case "Datagridview"
Dim datagridview As ListBoxControl = DirectCast(control, ListBoxControl)
datagridview.Items.AddRange(values.ToArray())
Try
Dim datagridview As ListBoxControl = DirectCast(control, ListBoxControl)
datagridview.Items.AddRange(values.ToArray())
Catch ex As Exception
End Try
Case "ListBox"
Dim listbox As ListBoxControl = DirectCast(control, ListBoxControl)
listbox.Items.AddRange(values.ToArray())
Try
Dim listbox As ListBoxControl = DirectCast(control, ListBoxControl)
listbox.Items.AddRange(values.ToArray())
Catch ex As Exception
End Try
Case "CheckedListBox"
Dim checkedlist As CheckedListBoxControl = DirectCast(control, CheckedListBoxControl)
For Each v As String In values
Dim posBefore As Integer = 0
While (checkedlist.FindStringExact(v, posBefore) > -1)
Dim pos = checkedlist.FindStringExact(v, posBefore)
' Wenn v gefunden wurde, anhaken
If pos >= 0 Then
checkedlist.SetItemCheckState(pos, CheckState.Checked)
posBefore = pos + 1
End If
' Verhindere Endlosschleife
If pos = 100 Then
Exit While
End If
End While
Next
Try
Dim checkedlist As CheckedListBoxControl = DirectCast(control, CheckedListBoxControl)
For Each v As String In values
Dim posBefore As Integer = 0
While (checkedlist.FindStringExact(v, posBefore) > -1)
Dim pos = checkedlist.FindStringExact(v, posBefore)
' Wenn v gefunden wurde, anhaken
If pos >= 0 Then
checkedlist.SetItemCheckState(pos, CheckState.Checked)
posBefore = pos + 1
End If
' Verhindere Endlosschleife
If pos = 100 Then
Exit While
End If
End While
Next
Catch ex As Exception
End Try
End Select
End Sub