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?
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?).