ASP.NET MVC ListBox - Add Multi-Column Items

Add Item
ID
COMPANY NAME
CITY
  • Exotic Liquids
    1
    Exotic Liquids
    London
    1
  • New Orleans Cajun Delights
    2
    New Orleans Cajun Delights
    New Orleans
    2
  • Grandma Kelly's Homestead
    3
    Grandma Kelly's Homestead
    Ann Arbor
    3
  • Tokyo Traders
    4
    Tokyo Traders
    Tokyo
    4
  • Cooperativa de Quesos 'Las Cabras'
    5
    Cooperativa de Quesos 'Las Cabras'
    Oviedo
    5
  • Mayumi's
    6
    Mayumi's
    Osaka
    6
  • Pavlova, Ltd.
    7
    Pavlova, Ltd.
    Melbourne
    7
  • Specialty Biscuits, Ltd.
    8
    Specialty Biscuits, Ltd.
    Manchester
    8
  • PB Knäckebröd AB
    9
    PB Knäckebröd AB
    Göteborg
    9
  • Refrescos Americanas LTDA
    10
    Refrescos Americanas LTDA
    Sao Paulo
    10
  • Heli Süßwaren GmbH & Co. KG
    11
    Heli Süßwaren GmbH & Co. KG
    Berlin
    11
  • Plutzer Lebensmittelgroßmärkte AG
    12
    Plutzer Lebensmittelgroßmärkte AG
    Frankfurt
    12
  • Nord-Ost-Fisch Handelsgesellschaft mbH
    13
    Nord-Ost-Fisch Handelsgesellschaft mbH
    Cuxhaven
    13
  • Formaggi Fortini s.r.l.
    14
    Formaggi Fortini s.r.l.
    Ravenna
    14
  • Norske Meierier
    15
    Norske Meierier
    Sandvika
    15
  • Bigfoot Breweries
    16
    Bigfoot Breweries
    Bend
    16
  • Svensk Sjöföda AB
    17
    Svensk Sjöföda AB
    Stockholm
    17
  • Aux joyeux ecclésiastiques
    18
    Aux joyeux ecclésiastiques
    Paris
    18
  • New England Seafood Cannery
    19
    New England Seafood Cannery
    Boston
    19
  • Leka Trading
    20
    Leka Trading
    Singapore
    20
  • Lyngbysild
    21
    Lyngbysild
    Lyngby
    21
  • Zaanse Snoepfabriek
    22
    Zaanse Snoepfabriek
    Zaandam
    22
  • Karkki Oy
    23
    Karkki Oy
    Lappeenranta
    23
  • G'day, Mate
    24
    G'day, Mate
    Sydney
    24
  • Ma Maison
    25
    Ma Maison
    Montréal
    25
  • Pasta Buttini s.r.l.
    26
    Pasta Buttini s.r.l.
    Salerno
    26
  • Escargots Nouveaux
    27
    Escargots Nouveaux
    Montceau
    27
  • Gai pâturage
    28
    Gai pâturage
    Annecy
    28
  • Forêts d'érables
    29
    Forêts d'érables
    Ste-Hyacinthe
    29
Displaying 29 items.

The ListBox control provides client-side methods for adding / removing items.

  • Use the add method of the options collection to add items to the list.

    Usage: ListBox1.options.add(text [, value] [, index]);
    - text - the text of the new item;
    - value - the value of the new item (same as text if not specified);
    - index - the position in the list where the new item should be added
          (if not specified, the item will be added at the end of the list);

  • Use the remove method of the options collection to remove items to the list.

    Usage: ListBox1.options.remove(index);
    - index - the index of the item to be removed;

This example uses overriden client-side methods of the control for allowing users to add multi-column items.