line feeds in Gridview cells? vbcrlf ? new line?

W

wildman

Is there any way for gridview cells to observe vbcrlf in the data?

I attempted to do this, but it does not seem to work.

Dim dgItem As GridViewRow
For Each dgItem In gridCollaborator.Rows
dgItem.Cells(6).Text.Replace("-", vbCrLf + "-")
Next

I also tried <br>, no luck

Thanks for any help or infomation.
 
E

Elmo Watson

You'll need to start with:

If e.Row.RowType = DataControlRowType.DataRow Then (of course add your
code, and then End If)

then try:
dgItem.Cells(6).Text=dgItem.Cells(6).Text.Replace("-", vbCrLf + "-")


David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
 
G

Guest

Is there any way for gridview cells to observe vbcrlf in the data?

I attempted to do this, but it does not seem to work.

        Dim dgItem As GridViewRow
        For Each dgItem In gridCollaborator.Rows
            dgItem.Cells(6).Text.Replace("-", vbCrLf + "-")
        Next

I also tried <br>, no luck

Thanks for any help or infomation.

dgItem.Cells(6).Text.Replace("-", vbCrLf + "-") would replace "-" by
the vbCrLf + "-" what makes no sense for the browser if you don't use
<pre> tag that preserves line breaks. Changing to "<br/>-" should make
a break in the text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top