Is this the best way?


Author
Message
William John Tello
William John Tello
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 17, Visits: 80
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).

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
The way you engineered it sounds like what I would do, if that is any reasurrance Wink. Just set the population settings to manual on the combo and handle it as you are doing.

The 3 combo boxes is certainly another viable option (you could even put them on 3 seperate panels of a panel manager control and navigate to the appropriate panel on click of the radio button), but I tend to agree with you on the uncecessary use of resources.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search