W
Woody Splawn
I have a question about technique with regard to filling drop downs.
I have a Winform that has several different tabs and tables associated with
it. In an effort to keep the load time small I would like to not fill the
fields with lookups at form load time. I have a grid on a tab of this form
that has six fields in it that have lookups associated with them. By
lookups I mean that the dropDown in the field is populated by doing a query
on a lookup table. When is the best time to populate (fill) these lookup
fields?
I am thinking that perhaps I could do this when the grid is moved-to like in
an Enter of GotFocus event. For this particular form, the user must
explicitely place himself in edit mode by selecting a button on a toolbar.
Perhaps I could have code (say in the got focus event for the grid) that
says in effect "If the user is in edit mode, run the code that fills the
various lookup fields". I don't really know the best way to deal with this
but to finish off my supposition. If I did the above, I would like for the
code not to run if the fields have already been filled. Perhaps I should
create a global boolean variable for the form called IveAlreadyFilledGridX
and set it to true once the grid has been filled.
If anyone has any suggestions I would appreciate a response.
I have a Winform that has several different tabs and tables associated with
it. In an effort to keep the load time small I would like to not fill the
fields with lookups at form load time. I have a grid on a tab of this form
that has six fields in it that have lookups associated with them. By
lookups I mean that the dropDown in the field is populated by doing a query
on a lookup table. When is the best time to populate (fill) these lookup
fields?
I am thinking that perhaps I could do this when the grid is moved-to like in
an Enter of GotFocus event. For this particular form, the user must
explicitely place himself in edit mode by selecting a button on a toolbar.
Perhaps I could have code (say in the got focus event for the grid) that
says in effect "If the user is in edit mode, run the code that fills the
various lookup fields". I don't really know the best way to deal with this
but to finish off my supposition. If I did the above, I would like for the
code not to run if the fields have already been filled. Perhaps I should
create a global boolean variable for the form called IveAlreadyFilledGridX
and set it to true once the grid has been filled.
If anyone has any suggestions I would appreciate a response.