0

I am taking a C# Class and have two questions about a program we are writing. It consists of a checkedListBox that displays 3 makes of Car by Group and then the ModelYear like:
Ford
2007
2006
2005
Chevrolet
2004
2004 etc

The listBox is filled using LINQ from an Access DB
I have two issues:
1) Each line has a checkBox...how do I disable the checkBox
for the Group / CarMake?

2) How do I allow a Year to be selected, then get the Make
that goes with it so I can retrieve the price and display all
three in a TextBox at the bottom?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Geekitygeek
0

The structure you're trying to achieve would be better suited to a treeview. You could have each group as a root node then each year as a child of the group node.
The treeview has an option to show checkboxes. You will still have checkboxes on the groups too (unless you want to venture into some complicated API calls to prevent them showing) but you could handle the check changed event and add some code that would check all the years for the group if the group is checked..eg if the user checks the checkbox next to Ford then all the years in the Ford group will be checked.

It would make it much simpler to tell which group to use when a year is selected.

Edited by Geekitygeek: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.