Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 01, 2012 06:24 AM by Manoj_B
Oct 01, 2007 12:08 PM|LINK
Oct 01, 2007 12:27 PM|LINK
Are these multiple strings in different fields of your datasource?
If so, convert the BoundField of your gridview into a TemplateField.
There, in the ItemTemplate, you can add any markup that you want, and you can add multiple fields in the same column.
Oct 01, 2007 03:50 PM|LINK
They are multiple strings in different fields in the database.
But the problem is, they are concatenated in the SQL query to form a single string.
I want the ability to add a line delimiter when I form the query, so that that line delimiter will be converted to a
new line when the string is displayed in gridview cell.
Oct 01, 2007 04:41 PM|LINK
U can do what Jos has said or
u may re-write the query as follows:
Oct 01, 2007 08:44 PM|LINK
Why not use "<br>" as a line delimiter?
If that is not possible, use a TemplateField, and use databinding like this:
<%# Eval(myField).ToString().Replace(";","<br>") %>
(this is when the semicolon is your delimiter)
Oct 08, 2007 05:55 AM|LINK
<br> doesnt work. If I include that as part of my SQL query, i get <br> on the screen, inside the cell. It doesnt get converted to a new line. char(13) is also not working... its translated to a space within the cell.
Is there some special character which can be used within the gridview cell which will be translated to a new line?
Oct 08, 2007 07:10 AM|LINK
The special character is <br>.
Did you try
as I said before?
Jan 28, 2008 05:17 PM|LINK
I had the same problem, but the thing to do is quite easy. You do not need to convert the column to a TemplateField. Still as a BoundField, just set the "HtmlEncode" field property to "false". Then, the "<br>" tag (and I believe, any other tags) will work.
Dec 01, 2012 06:24 AM|LINK
@arthur.lopes is correct
set the "HtmlEncode" field property to "false". then html tags are works in inside the cell of gridv view.