Hello,

I'm developing an application which has, among the others, a windows form with data grid and combo box. User has to select a value from combo box and I use the selected value to read data from database and fill the data grid.
Everything works fine, but sometimes there is a performance problem. When user insert a large amount of data it takes to long to load them in the data grid.
I want to optimize this data loading. I had idea to load a certain number of values and how user scrolls down the data grid, so load other values. Of course, data grid is not very high so I would load visible portion of data.

I don't know if this is such a good idea, but I will be grateful for advice.

Thank you

Recommended Answers

All 2 Replies

That depends on what type of binding source you're using. You can call DataTable.BeginLoadData() for example to turn off notifications while you're pulling down the cursor. Post your code or upload a sample project.

I read data from a database. Like a collection of some kind of resources. Then use this collection to create an ArrayList which is data source for data grid. After that, I iterate through this ArrayList adding elements one by one to data grid.
Grid is populated after I select value from combo box.

Maybe it is a complicated solution, but I had to implement it that way.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.