views:

43

answers:

2

I have this string in some sql:

FT_TBL.Title  + CHAR(13) + 'Job:' + str(FT_TBL.JobName) as Title

Now the Title is parsed as a boundfield in a c# gridview, the first row puts "Job" on the next line, but after that its random, some lines are next line some aren't! Any ideas?

+4  A: 

Instead of char(13) use <br /> for line breaks in HTML.

Note : Do not forget to add HtmlEncode="false" to your columns that show HTML content :

<asp:BoundField DataField="Title" HtmlEncode="false" />
Canavar
This is exaclty it - unless you flag the column as 'nowrap' HTML will wrap w/o the linebreak
n8wrl
<br /> doesnt seem to work as it just adds <br /> to the text now and doesnt parse it as html in the boundfield :(
David
thanks so much!!!!
David
A: 

Try combining carriage return with line feed:

FT_TBL.Title  + CHAR(10) + CHAR(13) + 'Job:' + str(FT_TBL.JobName) as Title
Registered User