datagrid and leading spaces in fields

Discussion in 'ASP .Net' started by SKG, Jul 14, 2004.

  1. SKG

    SKG Guest

    i have leading spaces in my database fields. When they appear in the
    datagrid in browser,
    they seem to be truncated. I did view source in browser and found that there
    are indeed spaces but when browser
    displays it crunches them in datagrid. Also i have update and delete
    buttons options in this datagrid.
    How can i display the leading spaces.?
    TIA
    SKG, Jul 14, 2004
    #1
    1. Advertising

  2. TIA,

    Spaces in browsers are always truncated. Do a replace of the spaces with
      (code for non-breaking space).

    MyString.Replace(" ", " ")

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "SKG" <> wrote in message
    news:...
    > i have leading spaces in my database fields. When they appear in the
    > datagrid in browser,
    > they seem to be truncated. I did view source in browser and found that

    there
    > are indeed spaces but when browser
    > displays it crunches them in datagrid. Also i have update and delete
    > buttons options in this datagrid.
    > How can i display the leading spaces.?
    > TIA
    >
    >
    S. Justin Gengo, Jul 14, 2004
    #2
    1. Advertising

  3. SKG

    Raterus Guest

    You'll have to replace the spaces with &nbsp; in the html, you should be able to pull this off in the itemdatabound event.

    text = text.Replace(" ", "&nbsp;")

    --Michael

    "SKG" <> wrote in message news:...
    > i have leading spaces in my database fields. When they appear in the
    > datagrid in browser,
    > they seem to be truncated. I did view source in browser and found that there
    > are indeed spaces but when browser
    > displays it crunches them in datagrid. Also i have update and delete
    > buttons options in this datagrid.
    > How can i display the leading spaces.?
    > TIA
    >
    >
    Raterus, Jul 14, 2004
    #3
  4. SKG

    SKG Guest

    Thanks All!!
    "Raterus" <> wrote in message
    news:%...
    You'll have to replace the spaces with &nbsp; in the html, you should be
    able to pull this off in the itemdatabound event.

    text = text.Replace(" ", "&nbsp;")

    --Michael

    "SKG" <> wrote in message
    news:...
    > i have leading spaces in my database fields. When they appear in the
    > datagrid in browser,
    > they seem to be truncated. I did view source in browser and found that

    there
    > are indeed spaces but when browser
    > displays it crunches them in datagrid. Also i have update and delete
    > buttons options in this datagrid.
    > How can i display the leading spaces.?
    > TIA
    >
    >
    SKG, Jul 14, 2004
    #4
    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. John Nagle
    Replies:
    4
    Views:
    581
    James Antill
    Aug 7, 2007
  2. Delaney, Timothy (Tim)
    Replies:
    0
    Views:
    559
    Delaney, Timothy (Tim)
    Aug 7, 2007
  3. John B. Matthews
    Replies:
    4
    Views:
    652
    John B. Matthews
    Sep 12, 2008
  4. Roedy Green
    Replies:
    3
    Views:
    610
  5. johkar
    Replies:
    2
    Views:
    2,841
    Mayeul
    Dec 10, 2009
Loading...

Share This Page