frmRowEditor

This commit is contained in:
Jonathan Jenne
2021-10-15 16:36:31 +02:00
parent 12aa22ebdf
commit b7602d896a
8 changed files with 382 additions and 22 deletions

View File

@@ -0,0 +1,52 @@
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraVerticalGrid.Rows
Imports ImporterShared.Documents
Public Class frmRowEditor
Private Row As DataRow
Private Columns As List(Of String)
Public Sub New(pRow As DataRow, pColumns As List(Of String))
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Row = pRow
Columns = pColumns
End Sub
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Row Is Nothing Then
Exit Sub
End If
Dim oDataTable As New DataTable()
Dim oDict = New Dictionary(Of String, String)
For Each oColumn As String In Columns
Dim oValue
Try
oValue = Row.Item(oColumn)
Catch ex As Exception
oValue = String.Empty
End Try
oDict.Add(oColumn, oValue)
Next
oDataTable.Columns.Add("KEY")
oDataTable.Columns.Add("VALUE")
For Each oKV In oDict
oDataTable.Rows.Add(oKV.Key, oKV.Value)
Next
GridControl1.DataSource = oDataTable
GridView1.BestFitColumns()
End Sub
End Class