About the display when the number of items in the combo box is large

0
0

Hello.

For example, when there are dozens to hundreds of combo box items, there is no problem, but initialization and dropdown display will be delayed when the number ranges from thousands to tens of thousands.

Is it impossible to make it fast by something innovative?

It’s about both data bound and unbound.
Items listed in the combo box are, for example, person names, subject names, etc.

Thank you.

——————————————————————-
Sample.

Imports System.Data

Public Class Window1

Private Sub Window1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim oDs As New DataSet
Dim oDt As New DataTable
Dim oDRow As DataRow

Dim nArticleCount As Integer = 50000

With oDt
.TableName = “article”
.Columns.Add(“uid”, Type.GetType(“System.Int32”))
.Columns.Add(“title”, Type.GetType(“System.String”))
End With

oDs.Tables.Add(oDt)

For ni As Integer = 0 To nArticleCount – 1
oDRow = oDt.NewRow
oDRow.Item(“uid”) = ni
oDRow.Item(“title”) = “title_” & ni.ToString
oDt.Rows.Add(oDRow)
Next

With ComboBox1
.DataSource = oDt
.DisplayMember = “title”
.ValueMember = “uid”
.SelectedIndex = -1
End With

End Sub

End Class

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
nArticleCount
< 100 No problem
100 – 1000 No problem
about 2000 Display starts to flicker when drop down
about 10000 Display flickers when drop down
about 50000 Freeze on drop down
——————————————————————-

  • You must to post comments
0
0

Hi Masafumi,

until the VirtualScroll feature is available, you can take a look on this 2 articles.

1. https://www.modernizing-applications.de/ihre-informationen/blog/posts/2018/april/wisej-s-virtualmode/
2. https://www.modernizing-applications.de/ihre-informationen/blog/posts/2018/june/wisej-combobox-with-autosuggest/

The first one explains how to use the VirtualMode of the DataGridView control.

The second one uses the modified DataGridView control as DropDownControl for a UserComboBox.

Best,

Jens

  • Masafumi Okuro
    Hi Jens, Thank you for the information. I will read the articles. Masafumi
  • You must to post comments
0
0

Hi, Tiago,

Thank you for your quick decision. I expect it.

  • You must to post comments
0
0

Hi Masafumi,

We are planning to add VirtualScroll property to ComboBox. This should fix it as data is transferred ony when it’s needed. Logged as WJ-9170

  • You must to post comments
0
0

Hi, Tiago,

Thank you for your quick answer.
I looked at the MSDN thread you presented.
And I tried to fix the code, but from the conclusion there was not much difference.
I originally transplanted the code that was working on VWG, but since VWG worked relatively lightly, I asked a question like this.

Thank you.

  • You must to post comments
0
0

Hi Masafumi,

Did you try what is suggested in this MSDN thread?

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.