Link to home
Start Free TrialLog in
Avatar of Unzip_The_Ripper
Unzip_The_RipperFlag for United States of America

asked on

new line character in gridview cell

How do I get newline characters to work in a gridview cell?

I have the query below for now.  It doesn't work, nor do any other newline characters when I reference the column in my gridview.  I want the address to be formatted like:

555 Test Dr.
Exam, FL. 55555

Instead I get:

555 Test Dr. \r Exam, FL. 55555
CREATE PROCEDURE dbo.usp_SEL_CL_Net_GetMortgageInformation
	@PolicyID AS VARCHAR(15),
	@InceptionDate AS SMALLDATETIME,
	@PostDate as DATETIME
AS
	Select [MortgageeID] AS 'Mortgagee Number', 
		[Name] AS 'Mortagee Name', 
		'Address' = CASE WHEN [Address2] = '' THEN
				[Address1] + ' \r ' + [City] + ', ' + [State] + '. ' + [ZipCode] 
			    ELSE
				[Address1] + ' \r ' + [Address2] + ' \r ' + [City] + ', ' + [State] + '. ' + [ZipCode]
			    END,
		[LoanID] AS 'Loan Number'
	From PlMortgage WITH (NOLOCK) 
	Where PolicyID = @PolicyID And 
		InceptionDate = @InceptionDate And 
		PostDate = @PostDate 
	Order by MortgageeID
GO

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jeeva Subburaj
Jeeva Subburaj
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Unzip_The_Ripper

ASKER

Perfect.  This fixed it.  Thanks.