Solved

DataGridViewComboBoxColumn dynamically fill data

Posted on 2011-09-27
4
1,073 Views
Last Modified: 2013-12-17
My problem is that DataGridViewComboBoxColumn becomes very slow when populated with a lot of items (more than 1000). 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 working faster? Problem is, how to implement this? Has anyone meet that problem before?
0
Comment
Question by:AntonioRodrigo
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Mrunal earned 250 total points
ID: 36716530
Hi,
Yes definitely you can load combo box options on combo scroll event. But for this you have to bind / add options to combo from client side.
here are some references:

http://code.msdn.microsoft.com/VBASPNETInfiniteLoading-10c3f379
http://ajaxian.com/archives/endless-pageless-keep-scrolling-for-more-content
http://www.codeproject.com/KB/ajax/AjaxScrollingPagination.aspx

But further, I will suggest you auto-complete functionality for your scenario.

You can achieve this through jquery

see:
http://docs.jquery.com/Plugins/autocomplete

and also from ajax toolkit.
see:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/autocomplete/autocomplete.aspx



0
 

Author Comment

by:AntonioRodrigo
ID: 36716618
As I can see, this is valid for ASP.NET. I am using Windows forms - sorry, I've forgot to mention that.
0
 
LVL 15

Assisted Solution

by:x77
x77 earned 250 total points
ID: 36719721
Note that Dgv ComboBox Column fills each time you enter on Edit Mode.

If you asociate this with a Column on a DataTable, then it needs go over DataView and Get Column Values.

When you End Edit this column, DataView is disposed and control cleared.
DataView takes time to build.

You can create a new DataView and use it as datasource to Column.
0
 

Author Comment

by:AntonioRodrigo
ID: 36966590
The solution exists - I've used example from Microsoft web site and change it a little bit. Now, my combo box is a part of DataGridView. But - I must not set autocomplete option. This autocomplete is slowing down whole control.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question