listbox stripping whitespace

2 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Jun 2008

    Posted 12 Jan 2010 Link to this post

      We are populating a listbox with a list of customer applications (string values):



    a = GetCustomerApplications.ExecuteReader();



    this.RadApplicationsListBox.DataSource = a;




      It appears any application with multiple spaces in the string will be stripped down to a single space.

      value in the database:  "Test  Aplication"
     as displayed in list box:  "Test Aplication"

    Has anyone come across this?  Or any other anomalies in the rendering of values in the listbox that we need to account for?


  2. Kamen Bundev
    Kamen Bundev avatar
    1532 posts

    Posted 13 Jan 2010 Link to this post

    Hello David,

    The issue you describe is not a problem in RadListBox but instead how web browsers render whitespace in general. Whitespace is always collapsed to one as per white-space: normal specification unless in a PRE block or if non-breaking spaces are used ( ). The easiest way to overcome that is to use item template with a pre tag in it which should allow whitespace rendering.

    Kamen Bundev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top