Gridview滚动条 [英] Gridview Scrollbar

查看:97
本文介绍了Gridview滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我,如果我没有更多信息,如何启用Gridview的滚动条.的列?
当我尝试时,我的浏览器也显示滚动.请帮帮我.
我的代码是

Can someone tell me how can i enable scroll bar of Gridview when i have more no. of column?
When i tried, my browser also shows scroll. Please help me.
my code is

<asp:panel id="Panel1" runat="server" scrollbars="Auto" height="300" width="99%" xmlns:asp="#unknown" />



在此先感谢



thanks in advance

推荐答案

看看这个:
如何使用ScrollBar创建GridView? [ [ ^ ]如果需要更多.
Have a look at this:
How To Create GridView With ScrollBars?[^]

Try this [^]if needed more.


将Gridview放在具有scrollbars ="Auto"的面板中,并通过styleSheet.css文件代码固定gridview的标题.
< style type ="text/css">
.header
{
font-weight:bold;
位置:绝对;
背景颜色:白色;
}
</style>
---------

---------
受保护的void GridView1_RowDataBound(对象发送者,GridViewRowEventArgs e)
{
如果(e.Row.RowType == DataControlRowType.DataRow)
{
if(e.Row.RowIndex == 0)
e.Row.Style.Add("height","40px");
}
}

通过此解决方案.这将帮助您更多...
Put your Gridview inside a panel having scrollbars="Auto" and fixed the header of gridview through styleSheet.css file code.
<style type="text/css">
.header
{
font-weight:bold;
position:absolute;
background-color:White;
}
</style>
---------
and
---------
protected void GridView1_RowDataBound(object sender,GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if(e.Row.RowIndex == 0)
e.Row.Style.Add("height","40px");
}
}

Go through this solution. This will help u more...



上面您已经提到,您的浏览器还显示了滚动条..
首先尝试将面板的宽度减小10%,然后将自动滚动应用于面板...

我希望它可以工作....

愉快的编码:很酷:
hi
Above you have mentioned that your browser is also showing scrollbar..
jst try to decrease the width of the panel may be by 10% and then apply the auto scroll to panel...

i hope it may work....

HAPPY CODING:cool:


这篇关于Gridview滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆