A
Ali
I am binding a hashTable to a dropDownList to pick a State (key: like New
York) and sends the state designation (value: NY) to a filtering procedure.
I have entered the states in the hashTable in alphabetical order, but the
dropDownList renders them in a non-order list.
code snippet:
Dim state as New hashTable
state.Add("Alabama", "AL")
state.Add("Alaska", "AK")
...
state.Add("Wyoming", "WY")
state.Add("Yokon Territory", "YT")
dropDownListState.DataSource = state.keys
dropDownListState.DataBind()
Question 1:
Why does the hashTable items order change in the DropDownList?
Question 2:
Can I sort a hashTable based on the key?
Question 3:
How is a sortedList different from a hashTable?
I am assuming that the hashTable is sorted on the hash, but I am not sure.
Thanks.
Ali
York) and sends the state designation (value: NY) to a filtering procedure.
I have entered the states in the hashTable in alphabetical order, but the
dropDownList renders them in a non-order list.
code snippet:
Dim state as New hashTable
state.Add("Alabama", "AL")
state.Add("Alaska", "AK")
...
state.Add("Wyoming", "WY")
state.Add("Yokon Territory", "YT")
dropDownListState.DataSource = state.keys
dropDownListState.DataBind()
Question 1:
Why does the hashTable items order change in the DropDownList?
Question 2:
Can I sort a hashTable based on the key?
Question 3:
How is a sortedList different from a hashTable?
I am assuming that the hashTable is sorted on the hash, but I am not sure.
Thanks.
Ali