listbox and multiple selection

Discussion in 'ASP .Net Web Controls' started by Ant, May 3, 2005.

  1. Ant

    Ant Guest

    I would like to get from a database several items and selected them in
    a listbox but only selects one. Here is my code.

    <asp:listbox id="lbTipoProy" runat="server" Width="152px"
    CssClass="caja" Enabled="False"
    SelectionMode="Multiple"></asp:listbox>

    Dim drFilaTProy As DataRow
    TTipoProyProgramas.fTTipoProyProgramasSEL(txtCodNombre.Text.Trim)
    If Not TTipoProyProgramas.FilasResultados Is Nothing
    Then
    For Each drFilaTProy In
    TTipoProyProgramas.FilasResultados
    Dim TTipoProyPrograma As New TTipoProyPrograma
    TTipoProyPrograma.IDProyecto =
    drFilaTProy.Item("IDTipoProyecto")
    item = New
    ListItem(TTipoProyPrograma.IDProyecto)
    lbTipoProy.SelectedIndex =
    lbTipoProy.Items.IndexOf(item)
    Next
    End If
    Ant, May 3, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGll?=
    Replies:
    5
    Views:
    673
    =?Utf-8?B?TGll?=
    Dec 14, 2004
  2. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,635
    Chris Kettenbach
    Jun 16, 2005
  3. Replies:
    10
    Views:
    24,943
    S. Justin Gengo [MCP]
    Feb 27, 2006
  4. =?Utf-8?B?V2FyYW4=?=

    Multiple Selection in Listbox when Edit the form

    =?Utf-8?B?V2FyYW4=?=, May 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    475
    =?Utf-8?B?V2FyYW4=?=
    May 4, 2006
  5. Listbox and multiple selection

    , May 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    153
    Ken Cox [Microsoft MVP]
    May 2, 2005
Loading...

Share This Page