strange stuffs

This commit is contained in:
Jonathan Jenne 2020-01-30 14:27:28 +01:00
parent 63f6db8138
commit ae9613d56e

View File

@ -481,14 +481,17 @@ Public Class ClassControlCreator
Next
oControl.DataSource = oDatatable
Dim oSource As New BindingSource() With {.DataSource = oDatatable}
oControl.DataSource = oSource
oControl.RefreshDataSource()
oControl.ForceInitialize()
Dim oGridView As GridView = oControl.DefaultView
oView.PopulateColumns()
For Each oRow As DataRow In DT_MY_COLUMNS.Rows
Dim o = oRow.Item("SPALTENNAME")
Dim p = oRow.Item("SPALTENBREITE")
Dim ocount = oGridView.Columns.Count
Dim ocount = oView.Columns.Count
' oGridView.Columns(oRow.Item("SPALTENNAME")).Width = oRow.Item("SPALTENBREITE")
Next
@ -501,8 +504,7 @@ Public Class ClassControlCreator
If GridTables.ContainsKey(e.Column.FieldName) Then
Dim oComboboxDataTable As DataTable = GridTables.Item(e.Column.FieldName)
'Dim oEditor As New RepositoryItemComboBox()
Dim oEditor As New RepositoryItemLookUpEdit()
Dim oEditor As New RepositoryItemComboBox()
Dim oItems As New List(Of String)
AddHandler oEditor.Validating, Sub(_sender As ComboBoxEdit, _e As CancelEventArgs)
@ -513,14 +515,35 @@ Public Class ClassControlCreator
End If
End Sub
For Each oRow2 As DataRow In oComboboxDataTable.Rows
Dim oValue = oRow2.Item(0)
Try
oValue &= $" | {oRow2.Item(1)}"
Catch ex As Exception
End Try
oEditor.Items.Add(oValue)
oItems.Add(oValue)
Next
oEditor.DataSource = oComboboxDataTable
e.RepositoryItem = oEditor
End If
End If
Next
End Sub
AddHandler oView.CellValueChanged, Sub(sender As Object, e As CellValueChangedEventArgs)
Dim oValue = e.Value.ToString()
Dim oView2 As GridView = TryCast(sender, GridView)
If oValue.Contains(" | ") Then
oValue = oValue.Split(" | ").ToList().Item(0)
oView2.SetRowCellValue(e.RowHandle, e.Column, oValue)
End If
End Sub
Return oControl
End Function