怎么在gridview的加入滚动条
发布时间:2011-06-22 17:12:05 文章来源:www.iduyao.cn 采编人员:星星草
如何在gridview的加入滚动条?
如何在gridview的加入滚动条?如果超高,就出现上下滚动条,如果超宽,出现左右滚动条
哪位给一个段代码?
------解决方案--------------------
------解决方案--------------------
asp:Panel ID="Panel1" runat="server" Height="185px" ScrollBars="Auto" Width="641px">
<asp:GridView ID="DG" runat="server" AllowPaging="True" AutoGenerateColumns="False" Width="865px" ForeColor="#000040">
</asp:GridView>
</asp:Panel>
或
.Freezing
{
position:relative ;
table-layout:fixed;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
.Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:2px;}
<div style="overflow-y: scroll; height: 200px;width:300px" id="dvBody">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing"
OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" Font-Size="12px" OnRowCreated="GridView1_RowCreated" >
<FooterStyle BackColor="White" ForeColor="#000066" />
<Columns>
<asp:BoundField DataField="姓名" HeaderText="姓名" />
</Columns>
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" CssClass="ms-formlabel DataGridFixedHeader"/>
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" CssClass="Freezing"/>
</asp:GridView>
</div>
gridview72例
------解决方案--------------------
外面加个div就行,让div出现滚动条
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
页面基类PageBase.cs代码,实现系统进入权限判断 这样思路有问题吗?
pagebase.cs 代码
C# code
public class PageBase:System.We...
-
linq中的表连接语句???
例如:album,artist,genre这三个表的连接语句。。谢谢
------解决方案--------------------
public PagedList<...
-
为什么Repeater控件生成的HTML有很多空行?
效果如下,每个超链接之后都自动换行。
<a target="_blank" href='http://v.gamefy.cn/v...
-
关于模式窗口关闭的问题(在线等,解答立刻结贴给分)
功能什么都做完了。问题有二:
1.关闭的时候父窗口不刷新。于是我在吊用模式窗口的...
-
ASP.NET 中为什么要把相对路径处理成 绝对路径
处理函数如下:
C# code
// Builds an absolute URL
private static strin...
-
asp.net里面像QQ相册那样列表然后预览的jquery特效
asp.net里面像QQ相册那样列表然后预览的jquery特效
谁有这样的完整例子,...
-
求高手共同破解JQGrid 4.1 for Asp.net(比GridView强大)
软件名称:jqSuite(此插件比asp.net自带GridView强大的多,但只能使用30天)
...
-
急!!!在线等 asp.net中页面传值刷新不跳转新建窗口
C# code
<asp:TemplateField HeaderText="操作管...
-
请教:asp.net 导出word文件思路
我要从数据库取数据,写到word文件里,请教高手指点.多谢了!
------解决方案--------------------...
-
jqGrid4定义按钮查询(用过jqGrid的高手请进,在线等)
如图,json格式数据已加载,如果不用JQGrid底部工具栏上查询按钮查询,用最上面自己...