formatting listbox into columns

Discussion in 'ASP .Net Web Controls' started by headware, Sep 6, 2003.

  1. headware

    headware Guest

    I'm trying to list data that is really best put into a table, but I
    need easy multi-select functionality, so I'm trying to go with a
    listbox. I attempted to use the PadRight() function of the string
    class to get the data to separate into columns, but the listbox seems
    to turn all the extra spaces into one space by the time it gets
    rendered. It only does this with spaces though. If I use another
    character like '.' it will work correctly but it looks awful. I saw a
    post on here that was put up a while ago in which someone had the
    exact problem I'm having, but no one gave him a solution that would
    work. Does anyone know of a way to do this?

    Thanks,
    Dave
     
    headware, Sep 6, 2003
    #1
    1. Advertising

  2. headware

    Alvin Bruney Guest

    why don't u use a textbox. set the rows to multi-select and then set the
    colum property to 2. then you can get the text to fall into the two columns.

    "headware" <> wrote in message
    news:...
    > I'm trying to list data that is really best put into a table, but I
    > need easy multi-select functionality, so I'm trying to go with a
    > listbox. I attempted to use the PadRight() function of the string
    > class to get the data to separate into columns, but the listbox seems
    > to turn all the extra spaces into one space by the time it gets
    > rendered. It only does this with spaces though. If I use another
    > character like '.' it will work correctly but it looks awful. I saw a
    > post on here that was put up a while ago in which someone had the
    > exact problem I'm having, but no one gave him a solution that would
    > work. Does anyone know of a way to do this?
    >
    > Thanks,
    > Dave
     
    Alvin Bruney, Sep 8, 2003
    #2
    1. Advertising

  3. headware

    headware Guest

    Well, there is no mutli-select functionality for a textbox as far as I
    know. There is a multi-line option, but that's different. Also, the
    Columns property really is misleadingly named. All that specifies is
    how many characters will fit in single row of text in the box. It
    should be called LineWidth or something like that.

    I really need the mutli-select functionality of the listbox. Someone
    suggested that you could use "&nbsp;" instead of spaces in the listbox
    text value. However, when I tried to do this it turned the &nbsp; into
    "&amp;nbsp;" so it would end up actually displaying "&nbsp;" in the
    text of the items. Is there any way to shut that off? There must be
    some way to put extra spaces into listbox text items!


    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in message news:<#>...
    > why don't u use a textbox. set the rows to multi-select and then set the
    > colum property to 2. then you can get the text to fall into the two columns.
    >
    > "headware" <> wrote in message
    > news:...
    > > I'm trying to list data that is really best put into a table, but I
    > > need easy multi-select functionality, so I'm trying to go with a
    > > listbox. I attempted to use the PadRight() function of the string
    > > class to get the data to separate into columns, but the listbox seems
    > > to turn all the extra spaces into one space by the time it gets
    > > rendered. It only does this with spaces though. If I use another
    > > character like '.' it will work correctly but it looks awful. I saw a
    > > post on here that was put up a while ago in which someone had the
    > > exact problem I'm having, but no one gave him a solution that would
    > > work. Does anyone know of a way to do this?
    > >
    > > Thanks,
    > > Dave
     
    headware, Sep 10, 2003
    #3
    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. blenderdude
    Replies:
    0
    Views:
    1,057
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    408
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    883
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,338
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...

Share This Page