datagird 滚动条问题 解决就散分
我想让datagird显示滚动条下面这条代码可以实现吗?网上找的都是这种代码
下面这代码本身有个问题就是datagrid按照记录数的增多而从上到下显示,不能控制datagrid在页面上占用的高度?那该把下面两句中的一句还是两句放到进去,该放到哪里去
datagird.items[1].cells[1].Height
style= "overflow-y:auto;
还有就是怎么把datagrid设置到了div中,我的网页中有2个Datagird 谢谢了 本人是菜鸟
<div id= "id1 " style= "TABLE-LAYOUT:fixed; Z-INDEX:106; LEFT:22px; WIDTH:100px; TOP:51px; HEIGHT:221px ">
<asp:DataGrid id= "DBGrid " runat= "server " Height= "163px " Width= "296px " AutoGenerateColumns= "False ">
<Columns>
<asp:BoundColumn DataField= "xh " HeaderText= "学号 ">
<HeaderStyle HorizontalAlign= "Center "> </HeaderStyle>
<ItemStyle Width= "70px "> </ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField= "xm " HeaderText= "姓名 ">
<HeaderStyle HorizontalAlign= "Center "> </HeaderStyle>
<ItemStyle Width= "70px "> </ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn HeaderText= "报考课程 " DataField= "kskm ">
<HeaderStyle HorizontalAlign= "Center "> </HeaderStyle>
<ItemStyle Width= "100px "> </ItemStyle>
</asp:BoundColumn>
</Columns>
</asp:DataGrid>
</div>
------解决方案--------------------jf