目前出现的问题是大多数列的内容都换行,有那么一两列不换行,不知怎么回事?
我只是让他绑定了后台的数据库中的某张表而已;
前台html代码如下:
......
<tr>
<td><asp:datagrid id="DataGrid" runat="server" BorderColor="Green" PageSize="5" AllowCustomPaging="True"
AllowPaging="True" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#00ff99" ItemStyle-Wrap="true"
AutoGenerateColumns="true" AlternatingItemStyle-BackColor="#ccffff" ItemStyle-Width="100px"
AlternatingItemStyle-Width="100px" AlternatingItemStyle-Wrap=true >
<PagerStyle Visible="False"></PagerStyle>
</asp:datagrid></td>
</tr>
........
我想让所有列换行或者都不换行,该咋办呢?谢谢高手指教!
我只是让他绑定了后台的数据库中的某张表而已;
前台html代码如下:
......
<tr>
<td><asp:datagrid id="DataGrid" runat="server" BorderColor="Green" PageSize="5" AllowCustomPaging="True"
AllowPaging="True" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#00ff99" ItemStyle-Wrap="true"
AutoGenerateColumns="true" AlternatingItemStyle-BackColor="#ccffff" ItemStyle-Width="100px"
AlternatingItemStyle-Width="100px" AlternatingItemStyle-Wrap=true >
<PagerStyle Visible="False"></PagerStyle>
</asp:datagrid></td>
</tr>
........
我想让所有列换行或者都不换行,该咋办呢?谢谢高手指教!
If IsDBNull(strValue) Then
FormatStr = " "
ElseIf CStr(strValue).Length >= intMaxLen Then
FormatStr = Microsoft.VisualBasic.Left(CStr(strValue), intMaxLen) & "..."
Else
FormatStr = CStr(strValue)
End If
End Function调用这个方法,把多余的字符断,太长了,还转行,看起来实在不爽的
我只是想简单设置DataGrid的属性,是否能实现?