how to break header text into two line gridview

how to break header text into two line gridview

18 Aug 2011 21:08:59

Hi,

One more great tips for you,The question is how to break header text into two line gridview?

Answer

<asp:GridView ID="gvSalesReport" runat="server" AutoGenerateColumns="False" Width="100%" >                                   
    <Columns>                                      
        <asp:BoundField HeaderText="SO Date <br/>(dd-MMM-yyyy HH:MM:ss)" HtmlEncode="false" DataField="sodate" DataFormatString="{0:dd-MMM-yyyy HH:MM:ss}"                                
            ItemStyle-Width="300px" />
	</Columns>                              
</GridView>

Key Points

1.You must set HtmlEncode="false", in order to parse html inside bound field.

2.You have to use <br/> tag inside the header text.

Thank you

Gold   Boarder
Posts: 156
From 03-Jun-2009
You're Points: 1106
Bookmark
^ Scroll to Top
</