Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,
i use

SQL
SELECT @columns=STUFF((SELECT DISTINCT ',    '+QUOTENAME(examid)+' AS '+ QUOTENAME(DayName +  CHAR(13)  + CONVERT(Nvarchar(10),(exammonth)) +'/'  + CONVERT(Nvarchar(10),(examday)) )
 FROM  examsTB  where act =1  GROUP BY DayName,examday,exammonth,examid  for XML Path(''),Type).value('.','Nvarchar(MAX)'),1,2,'') ;


to view the header in gridview two line

But not work .

What I have tried:

C#
RowHeaderColumn="2"
Posted
Updated 28-Dec-17 2:04am
Comments
Nakhia_ind 26-Dec-17 4:09am    
give the details code like funcion QUOTENAME
Member 12857222 27-Dec-17 6:02am    
I am sorry i not understand
Richard MacCutchan 26-Dec-17 7:20am    
What does "not work" mean?
Member 12857222 27-Dec-17 6:01am    
It is mean:
The header of gridview is supposed to appear on two lines
But the header of gridview appears on only one line

1 solution

Depends on what type of gridview so you need to provide more information. If this is a windows forms gridview then the answer is in the comments, use Chars 10 and 13. If this is a webgridview you need to use the code for a new line in html which is <br/>.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900