tags:

views:

71

answers:

3

Hello all,

I've a form and I'm doing databinding of my datagridview in the event "form load", the problem is, that the form takes a little (or a lot depends on the size of information) to load, because my data has a lot of binary information (photos) to binding there.

In some sites, we can see a picture saying "loading", which is cool and is good to the user, because I knows that is loading and not stoped. So, I wanted to simulate something like that to desktop application when I'm doing databinding to the table, can you help me?

A: 

You could show the 'loading' form in a different thread.

Also consider hard whether you need all of the data loaded with the form - could any of this data be loaded after the form load?

Try and give your application a feeling of perceived speed.

Galwegian
+1  A: 

You can't do much about the actual binding itself, since forms have thread affinity. However, you can load the data (from the database or where-ever) on a separate thread - look at BackgroundWorker, for example.

If the db-load is fast, but the binding is slow, you can look at things like "virtual mode" that exists for many standard list-based controls. This can reduce the time taken to bind by only looking at the immediately visible data.

Other than that, you can do things like changing the cursor, showing a splash on another thread, etc. It really depends where the time is being spent (have you profiled?).

Marc Gravell
A: 

Sometimes is not our decision to load the data after a user action. My client wants the data loaded without user action.

Thanks you for your answers :)