Monday, August 16, 2010

Datagrid Design on Windows Form?

I am using VB 2005 and have a datagridview thats bound to a table in a database. I have some collumns that are combo boxes that displays data from differents tables. The problem that I am having is that it takes some time for the data to load in the combo boxes and doesnt display when the user clicks the drop down. How can I speed that up?Datagrid Design on Windows Form?
Interesting to read about the DataGridView control; looks like it has some nice features.





My guess is that you have two problems.





1) Check that you have set a value for the MaxDropDownItems property to a reasonable number, such as 8. I am wondering if the value is set to bad value so that the data doesn't display.





2) Your SQL query for populating the drop down may be inefficient. Try testing the query separately. If you have installed SQL Server Management Studio (Express), you can run the query and then check the Execution Plan to see where the time is being spent. A bad query could result in a Cartesian join which runs a long time, creates a large number of rows, and is rarely the result intended. Again SQL Server Management Studio would let you see this easily.





Actually, the large number of records problem could explain the dropdown issue as well.

No comments:

Post a Comment