I'm binding a GridView to an LINQ query. Some of the fields in the objects created by the LINQ statement are strings, and need to contain new lines.
Apparently, GridView HTML-encodes everything in each cell, so I can't insert a <br /> to create a new line within a cell.
How do I tell GridView not to HTML encode the contents of cells?
Maybe I should use a different control instead?
What about setting the HtmlEncode
property to false
? To me, this is much simpler.
<asp:BoundField DataField="MyColumn" HtmlEncode="False" />