DataGrid数据源和滚动条在同时使用时有崩溃风险 #16479
Replies: 5 comments 3 replies
-
We kindly request that all issues be reported in English. This helps ensure clear communication and efficient handling of your concerns. |
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
I'm sorry about that. I encountered some issues while using the DataGrid, I quickly shake its horizontal scrollbar left and right when the data source of the DataGrid is frequently updated, the DataGrid throws an exception and cannot capture it, causing the program to end. I suspect there may be issues with multi-threaded processing but I am not capable of resolving them.
|
Beta Was this translation helpful? Give feedback.
-
@SagapoSheepL any manipulation with UI elements should happen on UI thread. Consider wrapping it into Dispatcher call: Or reworking how you do threading. |
Beta Was this translation helpful? Give feedback.
-
i meet the same question,so,i used a list which made by myself.here you are the code. maybe helpful for you.using AsyncObservableCollection instade of ObservableCollection. namespace AvaloniaRiderDemo.Common
} |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
构建一个DataGrid并且使用根据数据源自动生成数据的功能,然后频繁更新数据源,同时频繁拖动滚动条,DataGrid.ComputeDisplayedColumns方法会提示引用空对象的错误。应该是多线程处理了Column对象导致的。
To Reproduce
构建一个DataGrid,将它的AutoGenerateColumns属性打开,并且创建后台ViewModel对象绑定一个数组类型数据源,接下来构建一个线程为数据生成新的数组数据,打开界面,调整宽度使得表格出现横向的滚动条,然后伴随着数据刷新,左右快速的拖动滚动条,持续大约一分钟,有概率提示错误信息空对象的引用。
Expected behavior
No response
Avalonia version
11.1.0-beta2
OS
Windows, Linux
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions