datagridview in tab control

divjoy

Well-known member
Joined
Aug 25, 2013
Messages
159
Programming Experience
1-3
Hi,

I have a vb form with 4 datagridviews within a tab control with 4 tabs, my questions is when should I populate the dgv's ?

Should I place the code in the main form load event or when the user clicks on the specific tab?

I am using vb.net 2010 and sql server 2008

Regards
 
Hi Sterlingard,

I am not using bounded data, I use vb code to populatethe dgv's.

So was wondering what other programmers do in this scenario.

The main firm would load a little bit faster, and ifthe user did not click on some of the tab controls there would be no need to load the dgv data at all. Thus saving on connections etc...

Would be interested in peoples opinions.

kind regards
 
That's completely up to you and depends on what you're trying to achieve. If there's not much data then it probably doesn't make much difference. If the amount of data is significant then you have to decide what's more important to you: the form displaying in a usable state as quickly as possible or there not being a delay when the user selects a tab. It may well be possible to use a hybrid approach too, i.e. load data in a secondary thread and then display that data when it's required or even while the app is waiting for the user. There's rarely a right answer to how to design a system. It almost always depends on a number of variables and also personal preference.
 
Back
Top