vb.net - The data is read very fast from sql server but displayed too slow on devexpress gridview
问题描述
I'm using vb.net 2017 , Entity Framework 6 with sql server 2008r2.
On my form I have a devexpress gridview. The gridview is bound to a Bindingsource ( MyBindingsource ) on design time.
My table on database has around 2300 records.
On runtime I have this code :
....
dim myquery as ienumerable(of Myobject)
myQuery=From t in Context.Myobject select t
Mybindingsource.Datasource=Myquery.Tolist
all these instructions are executed instantly , and I've checked that the query contains all the 2300 records , but after that It need 4 minutes to display all the records in Gridview.
What can I do ?
Thank you !
Update
I have investigated all the events that i'm using with my grid , and i have detected that all the problems were caused by this :
Private Sub gridView_CustomRowFilter(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowFilterEventArgs)
Dim gridr As Object = gridView.GetRow(e.ListSourceRow)
e.Visible = IsNothing(gridr) OrElse context.Entry(gridr).State <> Entity.EntityState.Deleted
e.Handled = True
End Sub
With small data there's no problem , and this is why i have not noticed before. But i need this event because when the user delete a record , i don't delete it from bindingsource until the save button is pressed , but i want to hide from gridview.
What can i do ?
Thank you !
解决方案
推荐阅读
- c++ - CreateDC() 方法,而在某些打印机以及某些 Windows 环境中设置打印机失败
- python - 从 Tensorflow DeepLab v3 Demo 中提取图像分割图
- java - 如何从 Button 的 onClick 侦听器中删除 Firebase 数据库
- scipy - 如何判断 Wilcoxon 检验的结果?
- python - 连接 numpy 数组时出现值错误
- tensorflow - 用多 GPU 训练 deeplabv3+?
- ruby - Ruby Net::SSH::AuthenticationFailed:用户 root@xxxxxxxxx 的身份验证失败
- python - Django Rest Framework 如何从多个模型创建序列化程序
- angular - /dist 文件夹下的所有内容都用作 angular-cli 1.7 构建中的 index.html 文件
- aurelia-dialog - Aurelia-dialog BindingLanguage 必须实现 inspectTextContent()