all groups > asp.net datagrid control > august 2005 >
You're in the

asp.net datagrid control

group:

Grids, dropdown, sql queries and extra spaces


Grids, dropdown, sql queries and extra spaces eagle
8/22/2005 2:26:14 PM
asp.net datagrid 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 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?




Re: Grids, dropdown, sql queries and extra spaces Sagar
8/22/2005 5:25:44 PM
Please try SPACE and see if that works..

[quoted text, click to view]

Re: Grids, dropdown, sql queries and extra spaces eagle
8/23/2005 9:38:29 AM
That was a good idea, but it didn't work either.

[quoted text, click to view]

AddThis Social Bookmark Button