Okay I have a drop down list box and a set of three radio buttons on my Windows form. The items which populate the drop down list box are derived by three separate SQL queries against three separate tables depending upon which radio button is the one selected. So, the drop down list box is populated dynamically in this way.I have successfully achieved this by:
+ creating three separate data retrieval methods against three separate business objects (one for each table).
+ hooking three separate events for the click of each radio button.
+ within each radio button event I dynamically build the columns for the drop down list box and the list population settings and lastly call the requery method on the drop down list box.
This works really well, but I'm left wondering if I missed a more trivial way to solve the problem as I'm often guilty of taking the more difficult road when there was a much easier way staring me right in the face.
I did think that I could have easily populated three separate drop down list boxes and used the radio buttons to switch between them with the visible property, but that seems like such a huge waste of resources and I'm one of those developers that just doesn't like UIs that change dynamically (albiet in this case the change would not be visible, if you will pardon the pun, to the user).