0

This is my code:

<asp:TemplateField HeaderText="Comments" HeaderStyle-Width="60%">                                                                 
<ItemTemplate>
    <%# Eval("Comments").ToString().Replace(Environment.NewLine, "<br/>")%>  
</ItemTemplate>

This is not adding a line break due to which the grid is getting stretched. Please provide a solution.

bragboy
  • 34,892
  • 30
  • 114
  • 171
Gayatri
  • 343
  • 1
  • 6
  • 19
  • Css word-wrap is essay to use .Refer this http://stackoverflow.com/a/1147889/795683 – Sain Pradeep Jun 30 '15 at 12:09
  • I have a textarea which takes max. 2000 characters.On displaying it in gridview ,it does not go to the next line and keeps on extending horizontally. – Gayatri Jun 30 '15 at 12:12
  • you can add a `p` tag and set `Eval("Comments")` in it, do post sample value of `Eval("Comments")` so it give us clear idea – Satinder singh Jun 30 '15 at 12:53

0 Answers0