GridVIew標題不換行

wl1121發表於2009-05-30

 <asp:GridView runat="server" BackColor="White" BorderColor="#009fef" style=" word-break:keep-all " 
                    BorderStyle="Solid" BorderWidth="1px"   CellPadding="4">
                    <FooterStyle BackColor="White" BorderColor="#009fef"  ForeColor="#ff0000" BorderWidth="1px" />
                    <RowStyle BackColor="White" Height="20px" HorizontalAlign="center" BorderColor="#009fef" BorderWidth="1px"  BorderStyle="Solid"  ForeColor="#002C6F" />                 
                    <AlternatingRowStyle BackColor="#F1F9FE" Height="20px" BorderColor="#009fef" BorderStyle="Solid" />
                    <SelectedRowStyle BackColor="#009999" Height="20px" Font-Bold="True" BorderColor="#009fef" ForeColor="#CCFF99"  BorderWidth="1px"  BorderStyle="Solid" />
                    <PagerStyle BackColor="#99CCCC" Height="20px" ForeColor="#003399" HorizontalAlign="Left" BorderColor="#009fef" BorderStyle="Solid"/>
                    <HeaderStyle Wrap="False"  BackColor="#7BADC4"  BorderColor="#009fef" Height="25px"  Font-Bold="True" ForeColor="#003F85" BorderWidth="1px" />
                </asp:GridView>

 關鍵是這兩句

style=" word-break:keep-all " 和Wrap="False"

相關文章