ListBox and ArrayList problem

Results 1 to 2 of 2

Thread: ListBox and ArrayList problem

  1. #1
    Join Date
    Dec 1969

    Default ListBox and ArrayList problem

    Hello,<BR>I have a asp:ListBox and i want to databind it to an ArrayList<BR>containing integer id values.<BR>On databinding i would like to translate the values to something<BR>more meaningful such as a string description of what they stand for. The problem is that i dont know how to access each individual item when it is databound (there is no OnItemDataBound<BR>event for ListBox control) I thought of using DataTextFormatString property and setting it to a function that<BR>translates my ids but here again i dont know what and how to pass<BR>the individual ids from the textbox to the function.<BR>Is my only option to loop through the ArrayList at runtime and set each ListBox item individually (bypassing DataBinding functionallity completely?<BR>Thanks for any help you can offer.

  2. #2

    Default RE: ListBox and ArrayList problem

    It seems to be a design decision.<BR>If your buisness layer has friendly names to go with ID numbers, it should provide you with both, so it should provide a data structure with the name/value pairs to the presentation layer (UI)<BR>

Posting Permissions

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