Reputation: 3578
I have a webpage in which I let user to enter the contents, even if they change the line frequently in the textbox, the gridview when retrieves it from the database doesn't show any new line.
Upvotes: 2
Views: 5342
Reputation: 3891
Try something like this in your RowDataBound event if you're using C#
e.Row.Cells[0].Text = e.Row.Cells[0].Text.Replace(Environment.NewLine, "<br/>");
where e.Row.Cells[0].Text
is the text retrieved from the database.
Upvotes: 5