Professional Web Applications Themes

Grids, dropdown, sql queries and extra spaces - ASP.NET Data Grid Control

I have a sql query that combines 2 fields to end up as one, and binds to a dropdown list in a grid. I want to add spaces into the qry so the fields look like the are separate. But the drop down list seems to trim any extra spaces, and it displays any html codes I put in there. Does anyone know how to do this? This is what I want displayed in the drop down list, with a significant amount of space between the date and the currency: 01/01/05 12.00 01/02/05 13.00 This is what I've tried: select ...

  1. #1

    Default Grids, dropdown, sql queries and extra spaces

    I have a sql query that combines 2 fields to end up as one, and binds to a
    dropdown list in a grid. I want to add spaces into the qry so the fields
    look like the are separate. But the drop down list seems to trim any extra
    spaces, and it displays any html codes I put in there. Does anyone know how
    to do this?
    This is what I want displayed in the drop down list, with a significant
    amount of space between the date and the currency:

    01/01/05 12.00
    01/02/05 13.00

    This is what I've tried:

    select Convert(varchar, datBillDate, 1) + '     ' +
    Convert(varchar, curAmountOwed) as ddldisplay from tbl

    select Convert(varchar, datBillDate, 1) + '     ' +
    Convert(varchar, curAmountOwed) as ddldisplay from tbl

    Result: 01/01/05      12.00

    select Convert(varchar, datBillDate, 1) + Char(9) + Char(9) + Char(9) +
    Char(9) + Convert(varchar, curAmountOwed) as ddldisplay from tbl

    Result (displays as just one space): 01/01/05 12.00

    I've tried using Char(32) also.

    Any other ideas?





    eagle Guest

  2. #2

    Default Re: Grids, dropdown, sql queries and extra spaces

    Please try SPACE and see if that works..

    "eagle" <eagle> wrote in message
    news:eZPY6e1pFHA.2416TK2MSFTNGP14.phx.gbl...
    >I have a sql query that combines 2 fields to end up as one, and binds to a
    > dropdown list in a grid. I want to add spaces into the qry so the fields
    > look like the are separate. But the drop down list seems to trim any
    > extra spaces, and it displays any html codes I put in there. Does anyone
    > know how to do this?
    > This is what I want displayed in the drop down list, with a significant
    > amount of space between the date and the currency:
    >
    > 01/01/05 12.00
    > 01/02/05 13.00
    >
    > This is what I've tried:
    >
    > select Convert(varchar, datBillDate, 1) + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
    > + Convert(varchar, curAmountOwed) as ddldisplay from tbl
    >
    > select Convert(varchar, datBillDate, 1) + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
    > + Convert(varchar, curAmountOwed) as ddldisplay from tbl
    >
    > Result: 01/01/05&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12.00
    >
    > select Convert(varchar, datBillDate, 1) + Char(9) + Char(9) + Char(9) +
    > Char(9) + Convert(varchar, curAmountOwed) as ddldisplay from tbl
    >
    > Result (displays as just one space): 01/01/05 12.00
    >
    > I've tried using Char(32) also.
    >
    > Any other ideas?
    >
    >
    >
    >
    >

    Sagar Guest

  3. #3

    Default Re: Grids, dropdown, sql queries and extra spaces

    That was a good idea, but it didn't work either.

    "Sagar" <mmsagarhotmail.com> wrote in message
    news:uolfzk3pFHA.3884TK2MSFTNGP10.phx.gbl...
    > Please try SPACE and see if that works..
    >
    > "eagle" <eagle> wrote in message
    > news:eZPY6e1pFHA.2416TK2MSFTNGP14.phx.gbl...
    >>I have a sql query that combines 2 fields to end up as one, and binds to a
    >> dropdown list in a grid. I want to add spaces into the qry so the fields
    >> look like the are separate. But the drop down list seems to trim any
    >> extra spaces, and it displays any html codes I put in there. Does anyone
    >> know how to do this?
    >> This is what I want displayed in the drop down list, with a significant
    >> amount of space between the date and the currency:
    >>
    >> 01/01/05 12.00
    >> 01/02/05 13.00
    >>
    >> This is what I've tried:
    >>
    >> select Convert(varchar, datBillDate, 1) +
    >> '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + Convert(varchar, curAmountOwed) as
    >> ddldisplay from tbl
    >>
    >> select Convert(varchar, datBillDate, 1) +
    >> '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + Convert(varchar, curAmountOwed) as
    >> ddldisplay from tbl
    >>
    >> Result: 01/01/05&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12.00
    >>
    >> select Convert(varchar, datBillDate, 1) + Char(9) + Char(9) + Char(9) +
    >> Char(9) + Convert(varchar, curAmountOwed) as ddldisplay from tbl
    >>
    >> Result (displays as just one space): 01/01/05 12.00
    >>
    >> I've tried using Char(32) also.
    >>
    >> Any other ideas?
    >>
    >>
    >>
    >>
    >>
    >
    >

    eagle Guest

Similar Threads

  1. Special Character And Extra Spaces
    By WEBDavid in forum Macromedia Contribute General Discussion
    Replies: 3
    Last Post: March 27th, 06:53 AM
  2. Replies: 2
    Last Post: November 20th, 01:09 PM
  3. Replies: 0
    Last Post: November 17th, 11:21 PM
  4. Replies: 0
    Last Post: November 11th, 12:31 AM
  5. #26192 [NEW]: The mail function out putting extra spaces between each line
    By bpaulson at chieftain dot com in forum PHP Development
    Replies: 0
    Last Post: November 10th, 10:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139