Posted on: 7/31/2013 6:56:08 AM | Views : 206

Hi all,

I got a question.
How do you allow line break in a datatable gridview?
dgdItems is my datagrid. I put the code as highlighted in bold into the ItemDatabound but it didnt seem to work. :(
Please see the codes below.
======================================================================================
Protected Sub dgdItems_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgdItems.ItemDataBound
Try
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Cells(2).Text = e.Item.Cells(2).Text.Replace(vbCrLf, "<br/>")
'valid e.Item.Cells(6).Text = String.Format("{0:N2}", CType(e.Item.Cells(6).Text, Double))
e.Item.Cells(7).Text = String.Format(&quo ...

Go to the complete details ...