Problem with DropDownList

Discussion in 'ASP .Net Web Controls' started by APatel, Mar 21, 2006.

  1. APatel

    APatel Guest

    DropDownList is automatically trimming the string but i wanted to append the
    space with the string value in the dropdownlist (C# ASP.NET).

    Is there any way to add space since the dropdownlist automatically trims the
    stringvariable ?

    Following are the things which i already tried :
    1)
    I tried adding leftPad and RightPad property of the string but it doesnt work.
    2)
    I also tried appending " " space to the string variable
    3)
    I tried appending to the variable string
    4)
    I tried using class String constructor
    Ex: String str = new String(' ',10)
    5)
    I tried appending "\t" character to the string

    All this doesnt work.

    Is this a problem with Dropdownlist ?? or is there any way to achieve the
    desire result.
     
    APatel, Mar 21, 2006
    #1
    1. Advertising

  2. The problem isn't with DropDownList, it's with the fact that HTML ignores
    (in most cases) whitespace. What you need to do is rather than use spaces,
    use the HTML character code   instead.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "APatel" <> wrote in message
    news:...
    > DropDownList is automatically trimming the string but i wanted to append
    > the
    > space with the string value in the dropdownlist (C# ASP.NET).
    >
    > Is there any way to add space since the dropdownlist automatically trims
    > the
    > stringvariable ?
    >
    > Following are the things which i already tried :
    > 1)
    > I tried adding leftPad and RightPad property of the string but it doesnt
    > work.
    > 2)
    > I also tried appending " " space to the string variable
    > 3)
    > I tried appending to the variable string
    > 4)
    > I tried using class String constructor
    > Ex: String str = new String(' ',10)
    > 5)
    > I tried appending "\t" character to the string
    >
    > All this doesnt work.
    >
    > Is this a problem with Dropdownlist ?? or is there any way to achieve the
    > desire result.
     
    Nathan Sokalski, Mar 21, 2006
    #2
    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. mr2_93
    Replies:
    1
    Views:
    3,600
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,234
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,869
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,301
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    12,000
    shauns1
    Nov 1, 2006
Loading...

Share This Page