Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hey!
So i have a task where I am create an application for the user to select the name of a tree, and select 2 different years ( like 1920 and 1980) and then the app will show how many trees there were of that type in those 2 years. Im quite the beginner in programming, but really eager to learn! The difficulty on this shoudln't be too high, so I tried a little with dropdownlists, but couldn't quite figure out how to link them :/
 
This is the info i was given..
 
Trees   1915 1950 1970 1990 1992 2000
Furu     20   31   53   89   102 117
Gran     23   39   72   89   92  99
Lauvtre  4    6    8    12   15  18
 
Is ddl even the right solution for this?
 
Thanks for any help! =)
Posted 21-May-13 3:29am
Edited 21-May-13 4:18am
(no name)114.3K
v3
Comments
V. at 21-May-13 8:37am
   
You're not clear. Why would you want to select 2 years and not 5 or 10 ? Or do you want to select the number of trees between year 1 and year 2 ? What dropdown list should be 'linked', what do you mean by that? Best example of linked lists are country, city, street options eg. it is indeed not that difficult.
Twinniez at 21-May-13 8:40am
   
What i want is for the user to be able to select 2 of the years listed above and 1 of the tree types, and then the app will print how many trees there were of that exact tree in both of those years
lukeer at 21-May-13 9:23am
   
That still doesn't link the lists. It's just 3 lists containing trees, firstYears and secondYears.
 
Except there should be some extra logic that perhaps prevents using the same year twice, second must be later than first, and so on. Is there some such condition?
Zafar Sultan at 21-May-13 9:29am
   
So what is the problem? What have you tried so far?
Twinniez at 21-May-13 9:34am
   
My problem now is that when i select the tree "furu" and the year "1950" how do i make it extraxct the info for how many there were of that exact tree that exact year?
NJRoha at 21-May-13 16:25pm
   
Since you did not provide much detail, I would assume you are trying to filter the data based on the tree and year selection and find out what would be the tree count for the selected tree and year combination. To do so you need to maintain the x-ref between tree and year for counts. Once you do that, you can query the data once selection is being made. You can either store the values in DataTables in DataSet so that you can query them easyly and in-memory.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,192
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 21 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100