This commit is contained in:
SchreiberM
2016-06-03 14:10:41 +02:00
parent 494c32d7a7
commit aa56df9681
4 changed files with 18 additions and 9 deletions

View File

@@ -122,7 +122,6 @@
' Als letztes setzen wir die DataSource
control.DataSource = dt
control.EndUpdate()
sw.Stop()
' Console.WriteLine("SetDataSource for {0} took {1}ms", control.Name, sw.ElapsedMilliseconds)
End Sub
@@ -533,12 +532,16 @@
Public Shared Sub LoadValue(control As DevExpress.XtraGrid.GridControl, values As List(Of Object))
Dim gridview As DevExpress.XtraGrid.Views.Grid.GridView = control.MainView
Dim focused As Boolean = False
For i As Integer = 0 To gridview.RowCount - 1
Dim fieldName As String = gridview.Columns(0).FieldName
Dim rowhandle As Integer = gridview.GetRowHandle(i)
Dim rowvalue As String = gridview.GetRowCellValue(rowhandle, fieldName)
If values.Contains(rowvalue) Then
If focused = False Then
gridview.FocusedRowHandle = rowhandle
focused = True
End If
gridview.SelectRow(rowhandle)
End If
Next