DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 24 Apr 2007 15:02:21 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.datagridcontrol        back       

Thread Index
  1    John Doe
          2    John Timney \(MVP\)


Add newline to Gridview cell   
I'm binding a Gridview to a DataTable.  I want to display the Gridview cells 
with multiline values.  In populating the data for the DataTable, I use 
Environment.Newline but the data doesn't display in Gridview as multiline:

newRow[myDataColumn.Ordinal] = diff.ToString("N")+ Environment.Newline + 
pct.ToString("P");
Date:Tue, 24 Apr 2007 15:02:21 -0700   Author:  

Re: Add newline to Gridview cell   
Look at your source code output and I would hazard a guess that your newline 
isn't being rendered as <br>, which in html would create a newline.  If I 
recall correctly, you can only do this using templatefields, so have a read 
of a few tutorials like this one to start:

http://aspnet101.com/aspnet101/tutorials.aspx?id=58

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


"John Doe"  wrote in message 
news:ut9B9wrhHHA.3960@TK2MSFTNGP02.phx.gbl...

> I'm binding a Gridview to a DataTable.  I want to display the Gridview 
> cells with multiline values.  In populating the data for the DataTable, I 
> use Environment.Newline but the data doesn't display in Gridview as 
> multiline:
>
> newRow[myDataColumn.Ordinal] = diff.ToString("N")+ Environment.Newline + 
> pct.ToString("P");
>
>
> 
Date:Sat, 28 Apr 2007 22:47:30 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us