DataGrid控件换行问题?
Posted on 八月 16rd, 2007 由 admin
请问各位兄弟姐妹,在datagrid控件中,如何使某一单元格可以换行?
推荐阅读
网友:sjc0
给你一个例子
先设定datagrid宽度
<asp:datagrid id="datagrid1" runat="server" style="word-break:break-all" font-names="宋体" font-size="9pt" borderstyle="none" bordercolor="#3366cc" allowsorting="true" borderwidth="1px" cellpadding="4" datakeyfield="contractid" pagesize="8" allowpaging="true" autogeneratecolumns="false" width="600">
再设定itemstyle-width="你想要的宽度"
<asp:boundcolumn datafield="contractname" itemstyle-width="300" headertext="名称">
<headerstyle wrap="false" horizontalalign="center" verticalalign="middle"></headerstyle>
<itemstyle></itemstyle>
</asp:boundcolumn>


讨论区