Grids, dropdown, sql queries and extra spaces

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  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. Similar Questions and Discussions

    1. Special Character And Extra Spaces
      Hi All, This may be a simple problem to fix (i hope) but my searching has found nothing. When i publish documents from word to contribute i...
    2. Edit Mode - How do I populate dropdown in edittemplate from dropdown in another column?
      I have a datagrid with 2 columns that I want to interact when I'm in Edit Mode. I've reproduced just the columns I want to interact below. I can...
    3. #26192 [Fbk->NoF]: The mail function out putting extra spaces between each line
      ID: 26192 Updated by: sniper@php.net Reported By: bpaulson at chieftain dot com -Status: Feedback +Status: ...
    4. #26192 [Opn->Fbk]: The mail function out putting extra spaces between each line
      ID: 26192 Updated by: iliaa@php.net Reported By: bpaulson at chieftain dot com -Status: Open +Status: ...
    5. #26192 [NEW]: The mail function out putting extra spaces between each line
      From: bpaulson at chieftain dot com Operating system: Linux Redhat 7.3 PHP version: 4.3.4 PHP Bug Type: Mail related Bug...
  3. #2

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

    Please try SPACE and see if that works..

    "eagle" <eagle@yahoo.com> wrote in message
    news:eZPY6e1pFHA.2416@TK2MSFTNGP14.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

  4. #3

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

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

    "Sagar" <mmsagar@hotmail.com> wrote in message
    news:uolfzk3pFHA.3884@TK2MSFTNGP10.phx.gbl...
    > Please try SPACE and see if that works..
    >
    > "eagle" <eagle@yahoo.com> wrote in message
    > news:eZPY6e1pFHA.2416@TK2MSFTNGP14.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

Posting Permissions

  • You may not post new threads
  • You may 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