小弟 碰到这样的问题:
     一个网页是按 800X600大小设计的 ,上面有一个DataGrid显示数据,现在 我在浏览的时候,有许多数据比较长(一句话或者是很长的网址),这样DataGrid就被延长了很多,很难看一个页面突出去一块.我想限制以下DataGrid的大小 比如 800宽 就800宽,一旦超出就 在格子里长的那段自动换行.
    或者 一旦超出 就出现 垂直或水平的拖动条 
不知道怎么做,请诸位大侠 帮忙

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=A27CA611-2DE7-432D-8DBC-1512CEFDAA53
      

  2.   

    建议使用title
    前台
    <ItemTemplate>
    <asp:HyperLink id=HyperLink1 runat="server" Text='<%# FormatStr(databinder.eval(container.dataitem,"NewsTitle")) %>' ToolTip='<%# "新闻标题: " &amp; databinder.eval(container.dataitem,"NewsTitle")%>'>
    </asp:HyperLink>
    </ItemTemplate>
    后台
       Public Function FormatStr(ByVal strValue As Object) As String        Dim intMaxLen As Integer = 11        If IsDBNull(strValue) Then
                FormatStr = "&nbsp;"
            ElseIf CStr(strValue).Length >= intMaxLen Then
                FormatStr = Left(CStr(strValue), intMaxLen) & "..."
            Else
                FormatStr = CStr(strValue)
            End If    End Function方法是使用了title