就是datagrid可以显示一个滚动条,可以拖动的

解决方案 »

  1.   

    <TABLE id="Table1" borderColor="#cc9966" cellSpacing="1" cellPadding="2" width="720" border="1" runat="server">
    <TR align="center">
    <TD width="430" colSpan="2"></TD>
    <TD width="190" colSpan="2"></TD>
    </TR>
    <TR align="center">
    <TD width="360" bgColor="#66cc99"></TD>
    <TD width="180" bgColor="white"></TD>
    <TD width="120" bgColor="#99cccc"></TD>
    <TD width="60" bgColor="#009999"></TD>
    </TR>
    </TABLE>
    <div style="BORDER-RIGHT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW: auto; BORDER-LEFT: 0px; WIDTH: 736px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px; HEIGHT: 100px">
    <asp:datagrid id="DataGrid1" runat="server" BorderColor="#cc9966" CellSpacing="1" CellPadding="2" width="720px"
    AutoGenerateColumns="False" ShowHeader="False" AlternatingItemStyle-BackColor="#6699ff">
    <Columns>
    <asp:BoundColumn DataField="ID"><ItemStyle Width=360></ItemStyle></asp:BoundColumn>
    <asp:BoundColumn DataField="Name"><ItemStyle Width=180></ItemStyle></asp:BoundColumn>
    <asp:BoundColumn DataField="Birthday"><ItemStyle Width=120></ItemStyle></asp:BoundColumn>
    <asp:BoundColumn DataField="Sex"><ItemStyle Width=60></ItemStyle></asp:BoundColumn>
    </Columns>
    </asp:datagrid>
    </div>
      

  2.   

    看看这个http://dotnet.aspx.cc/ShowDetail.aspx?id=B3F3462D-DC34-41CE-9FEE-6965B2A3D1AD
      

  3.   

    这个我也看了,麻烦的很,而且还有bug
      

  4.   

    把DataGrid:放在<div 设置元素就可以了></div>里面;
      

  5.   

    DataGrid放在<div>里,不过做出来不是很好看。但不知道还有其他方法了
      

  6.   

    我已经把datagrid放在<div>里面了,为什么还是不行,我把代码贴出来大家看一下
    <div style="OVERFLOW-Y: scroll; OVERFLOW: auto; HEIGHT: 200px" align="justify" DESIGNTIMEDRAGDROP="212"><FONT face="宋体"></FONT>
    <asp:datagrid id="dgMain" runat="server" Width="96%" HorizontalAlign="Left" ShowFooter="True"
    CellPadding="4" BackColor="White" BorderWidth="1px" BorderColor="Black" AllowSorting="True">
    <SelectedItemStyle Font-Size="9pt" Font-Names="宋体" Font-Bold="True" ForeColor="White" BackColor="#FFCC66"></SelectedItemStyle>
    <EditItemStyle Font-Size="9pt" Font-Names="宋体" Font-Bold="True" HorizontalAlign="Left" ForeColor="Red"
    BackColor="Info"></EditItemStyle>
    <AlternatingItemStyle Font-Size="9pt" Font-Names="宋体" Wrap="False" HorizontalAlign="Left"></AlternatingItemStyle>
    <ItemStyle Font-Size="9pt" Font-Names="宋体" ForeColor="#330099" BackColor="White"></ItemStyle>
    <HeaderStyle Font-Size="Smaller" Font-Bold="True" Wrap="False" HorizontalAlign="Center" ForeColor="White"
    VerticalAlign="Middle" BackColor="#988281"></HeaderStyle>
    <FooterStyle HorizontalAlign="Center" ForeColor="#330099" VerticalAlign="Middle" BackColor="Silver"></FooterStyle>
    <Columns>
    .
    .
    .
    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
    </asp:datagrid></div>
      

  7.   

    给你思路用两个DATAGrid一个是不动的,一个是可以横向拉动的(用层来实现)
      

  8.   

    <!-- DataGrid做成象一个窗口似的,有自己的水平滚动条和垂直滚动条 -->
    <DIV style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 400px" align="left">
      你的DataGrid
    </DIV>