Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I retain the array order when I databind

Status
Not open for further replies.

roblasch

Programmer
Dec 30, 2000
168
US
Dim PageArray AS New HashTable()
PageArray.Add("Home Page",BaseURL)
PageArray.Add("Education",BaseURL & "/1")
PageArray.Add("Store",BaseURL & "/2")
RepeaterLinks.DataSource=PageArray
Page.DataBind()

I am using this code to fill a hashtable and then bind it to a repeater. The only problem that I have is the inability to control the order in which the items display. I want to have them display in the same order that I have put them into the hash. Is this possible, or am I being unreasonable?
 
If you are looking to keep a sorted list, I'd consider using an ArrayList instead and then you can just add the value along with a key and then sort on the key.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
But I need the key value of the hash table ... or is it possible to have a multiple dimension list array and bind to the repeater?
 
is it possible to have a multiple dimension list array and bind to the repeater
Yes, it is possible.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I am really stuck here. I've got the hash table bound to two different controls. They both are in the same order, but not the order that the hash table is typed. So what determines the order at databind? It seems random, except that it is alwats the same. Any insight?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top