开发者

DataGridViewComboBoxColumn very slow with lots of items

开发者 https://www.devze.com 2023-04-08 18:02 出处:网络
I have a DataGrid, with several columns. One of them is DataGridViewComboBoxColumn. I have a lot of items in this column - more than 1000 - and I need all of them. So grouping is not an option - all i

I have a DataGrid, with several columns. One of them is DataGridViewComboBoxColumn. I have a lot of items in this column - more than 1000 - and I need all of them. So grouping is not an option - all items must be there, users must be able to select from all. The problem is, DataGridViewComboBoxColumn becomes painfully slow, when number of items is about 1000, and above. This issues is well known to Microsoft, it dates back to Visual Studio 2005: http://connect.microsoft.com/VisualStudio/feedback/details/117024/datagridviewcomboboxcolumn-responds-very-slow-compared-with-the-stand-alone-combobox-control.

The problem is still present in Visual Studio 2010. Any ideas how to solve this?

Is it possible to fill DataGridViewComboBoxColumn with data partially? I mean (that was functionality fully working in Access), when you click DataGridViewComboBoxColumn, some items are displayed (lets say, 100 items). When you scroll down to the latest item, others are loaded (another 100) and so on. I don't see any other option to make DataGridViewComboBoxColumn开发者_JAVA百科 working faster? Problem is, how to implement this? Has anyone meet that problem before?

Greetings, Frenky


I assume you are using Windows Forms? If there is the possibility of switching to WPF, or at least hosting the WPF datagrid in a Windows Forms application (using ElementHost).

WPF can utilize virtualization and allows more items without lagging (because it does not look at items that aren't rendered, pretty much like you suggested).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号