I need some ideas on dynamic controls. Please comment!

Ok this really isn't a plea for help. I just need some ideas on this software im currently developing. Im writing this client / server application that uses remoting for the company I currently work for. On the server I can type in a number of different questions that I want to ask the end user and it's stored to a database. When the users log on with the client my server just passes the dataset which contains all the questions. There are also two other fields in the dataset which are if it is just a yes no question and if it is a manditory question that they have to answer.

Ok here is my problem where I need advice. Since the questions are dynamic meaning there can be any number of questions and the questions are different every time whats the best way to display input boxes for the user? I really want this to be "user friendly". I have thought of mabye having like a treeview kind of thing with each question listed as a node. When the user is on the current question it will have a little arrow by it. Then in a frame I will dynamically create textboxes and buttons for that specific question. I dont really know if this is the best solution for this problem and thought I would ask around to see if anybody else had some good input to offer or somebody has delt with the same kind of situation and how they solved it.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I had a couple of similar projects a few years ago. For one of them i took the same approach as you. a treeview with each question as a node on the left and a panel to place the full question and some textboxes/radio buttons/checkboxes etc...

For another i took a slightly different approach. The treeview was used for navigating the question categories and a panel for all of the questions in the category. It's a good way if you know there won't be too many questions in a category but the other way is better if you think there will be too many to fit nicely on a page.

Another thing i would suggest is create a custom control. Have a type property on it so you can set it to textbox, radio buttons or checkboxes and an answers property to supply an array of answers for radio button/check box mode. then it makes it easier on your forms so you dont have to duplicate loads of code for handling stuff. just set it's type, give it the question text and an array of answers if needed and it can return either an answer or an array of answers.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.