Solved

DataGridViewComboBoxColumn dynamically fill data

Posted on 2011-09-27
4
1,078 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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