Reputation: 729
Why FocusrowChanged GridView in DevExpress runs slowly in vb.net?
Is there a solution so it doesn't get slow? And the image data there are four thousand. If I run FocusedRowChanged in gridview in the image in pictureedit it immediately appears but the row shift is not direct and becomes slow.
Thanks
Private Sub GridView1_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridView1.FocusedRowChanged
Dim view As GridView = TryCast(sender, GridView)
If view.FocusedRowHandle = GridControl.AutoFilterRowHandle Then
Return
End If
Dim SUBFOLDERP As String = view.GetFocusedRowCellValue("SUBFOLDERP")?.ToString
Dim Filename1 As String = view.GetFocusedRowCellValue("FILENAME1")?.ToString
Dim Filename2 As String = view.GetFocusedRowCellValue("FILENAME2")?.ToString
parentpathimage = Directory.GetCurrentDirectory()
Dim filePath1 = DevExpress.Utils.FilesHelper.FindingFileName(parentpathimage & "\" & SUBFOLDERP & "\", Filename1, False)
Dim filePath2 = DevExpress.Utils.FilesHelper.FindingFileName(parentpathimage & "\" & SUBFOLDERP & "\", Filename2, False)
If Not String.IsNullOrWhiteSpace(filePath1) Then
PictureEdit1.Image = Image.FromStream(New MemoryStream(File.ReadAllBytes(filePath1)), True, False)
If Not String.IsNullOrWhiteSpace(filePath2) Then
PictureEdit2.Image = Image.FromStream(New MemoryStream(File.ReadAllBytes(filePath2)), True, False)
End If
End If
End Sub
Upvotes: 0
Views: 113