Simple Key/Value Structure

Results 1 to 6 of 6

Thread: Simple Key/Value Structure

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default Simple Key/Value Structure

    I'm looking for a simple key/value structure I can use for binding to a DropDownList that will maintain the order of elements as I put them in. The only two structures that I found in the help are Hashtable and SortedList, but neither maintains simple order. My last resort is making an array of DictionaryElements.. is there another way?

  2. #2

    Default RE: Simple Key/Value Structure

    Ugh. Have you tried ArrayList?<BR>Maybe even ListItemCollection...<BR><BR>Here is a list of the built-in objects that support the IList interface<BR><BR>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCollectionsIListClassTopic.asp<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    9

    Default RE: Simple Key/Value Structure

    When I bind an IList to a DropDown, it uses the value of the element for both the text and value parameters of the &#060;option&#062; tags. I need them to be different. Thanks for the response to my other question too.

  4. #4

    Default RE: Simple Key/Value Structure

    You&#039;re welcome.<BR><BR>Some (maybe most) of the classes tha implement IList support value and text.<BR><BR>The datasource property accepts an IList or an IListSource(dataset/datatable) <BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    9

    Default RE: Simple Key/Value Structure

    Can you show me a quick sample? I can&#039;t find anything in the helop

  6. #6

    Default RE: Simple Key/Value Structure

    Either could I, but Hashtable and SortedList both implement IList.<BR><BR>But that doesn&#039;t solve the ordering problem :S

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •