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.
Elmo Watson - 06 Mar 2008 20:16 GMT
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
> Is there any way for gridview cells to observe vbcrlf in the data?
>
[quoted text clipped - 8 lines]
>
> Thanks for any help or infomation.
Alexey Smirnov - 06 Mar 2008 20:22 GMT
On Mar 6, 8:53 pm, wild...@noclient.net wrote:
> Is there any way for gridview cells to observe vbcrlf in the data?
>
[quoted text clipped - 8 lines]
>
> 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
Peter Bromberg [C# MVP] - 06 Mar 2008 20:54 GMT
dgItem.Cells(6).Text.Replace("-", "<br/>-")
should work, unless the content is actually in a child control in the cell
such as a label.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
> Is there any way for gridview cells to observe vbcrlf in the data?
>
[quoted text clipped - 8 lines]
>
> Thanks for any help or infomation.