怎么给DataGrid的加个滚动条,包含横竖滚动条

解决方案 »

  1.   

    如何在DataGrid里面产生滚动条而不滚动题头 
    http://dev.csdn.net/develop/article/25/25538.shtm 
    创建固定表头、表格体滚动的DataGrid 
    http://dev.csdn.net/develop/article/18/18972.shtm
      

  2.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=0C25068E-55EA-4124-8CD6-726ECF5D5D3B
      

  3.   

    把Datagrid放入div中<DIV style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 100%; BORDER-BOTTOM: gray 1px solid; POSITION: relative; HEIGHT: 159px"
    ms_positioning="GridLayout"><asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server"
    Width="100%" AutoGenerateColumns="False" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2"
    GridLines="None" ForeColor="Black">
    <SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue"></SelectedItemStyle>
    <AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
    <HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
    <FooterStyle BackColor="Tan"></FooterStyle>
    <Columns>
    <asp:HyperLinkColumn Text="View/Edit" DataNavigateUrlField="F0300" DataNavigateUrlFormatString="F_FamilyServiceEditPage.aspx?ID={0}&amp;Mode=edit"
    HeaderText="View/Edit" NavigateUrl="F_FamilyServiceEditPage.aspx"></asp:HyperLinkColumn>
    <asp:BoundColumn DataField="F0302" HeaderText="Provider Type"></asp:BoundColumn>
    <asp:TemplateColumn HeaderText="Staff">
    <ItemTemplate>
    <asp:Label runat="server" Text='<%# getStaff(DataBinder.Eval(Container, "DataItem.F0303")) %>'>
    </asp:Label>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="Volunteer">
    <ItemTemplate>
    <asp:Label runat="server" Text='<%# getVolunteer(DataBinder.Eval(Container, "DataItem.F0313")) %>'>
    </asp:Label>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:BoundColumn DataField="F0304" HeaderText="Service Type"></asp:BoundColumn>
    <asp:BoundColumn DataField="F0304_3.M0301" HeaderText="Group"></asp:BoundColumn>
    <asp:BoundColumn DataField="F0309" HeaderText="Start Date" DataFormatString="{0:dd/MMM/yyyy}"></asp:BoundColumn>
    <asp:BoundColumn DataField="F0314" HeaderText="End Date" DataFormatString="{0:dd/MMM/yyyy}"></asp:BoundColumn>

    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
    </asp:datagrid></DIV>
      

  4.   

    如何在DataGrid里面产生滚动条而不滚动题头 
    http://dev.csdn.net/develop/article/25/25538.shtm 
    创建固定表头、表格体滚动的DataGrid 
    http://dev.csdn.net/develop/article/18/18972.shtm
    -----------------------------------------
    都是竖的滚动条,我最迫切需要的是横滚动条另外我想通过继承datagrid把这带滚动条的功能写成控件,
    所以我不想用 goody9807() 的方法
      

  5.   

    你可以在Datagrid外面加上一个层.当Datagrid太长的时候显示滚动条
    如:
    <DIV style="OVERFLOW: auto; WIDTH: 796px; HEIGHT: 396px">
    <Datagrid.......>
    </div>