| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付赛孚耐:软件保护加密专家
身份认证令牌USB KEY   
共有 402 人关注过本帖
标题:GridView界面设置问题.......
收藏  订阅  推荐  打印 
benbenmeng
Rank: 1
等级:新手上路
帖子:14
积分:240
注册:2007-4-27
GridView界面设置问题.......


想实现这样的效果,但是设置的gridview不行,大家能不能帮我设置下.........
我的代码如下
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderWidth="0px"
ShowFooter="true" CellSpacing="0" CellPadding="0" OnPageIndexChanging="GridView1_PageIndexChanging"
Width="100%"  AllowPaging="True" AllowSorting="True">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="90%" border="1" cellPadding="0" cellSpacing="0" style="border-bottom-color:#cfcfcf; border-left-color:#cfcfcf;border-right-color:#cfcfcf;">
<tr style="background-color:#dbdbdb;" valign="top">
<td style="width:10%;height:20px">登记人</td>
<td style="width:40%;" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"Writer")%></td>
<td style="width:10%;">登记日期</td>
<td style="width:40%;" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"WriteDate")%></td></tr>
<tr><td style="width:10%;height:50px" align="center">日志信息</td>
<td colspan="3" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"WriteInfo")%></td></tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
我的图片效果是




上面差了个线条~~~~~~~~~~~~~~~
附件: 只有本站会员才能下载或查看附件,请您 登录注册
搜索更多相关主题的帖子: GridView  界面  True  
2007-4-28 11:18
djx520
Rank: 1
等级:新手上路
威望:1
帖子:38
积分:480
注册:2007-4-2

你在模板里画个table然后丢几个lable按上面的样式排好,在用<%#Eval()%>绑
后台的代码就像平时绑一样就可以了

2007-4-28 14:30
benbenmeng
Rank: 1
等级:新手上路
帖子:14
积分:240
注册:2007-4-27

不是很明白你讲的方法,可不可以麻烦你贴个代码??/
我那上面基本上已经实现,现在是table最上面的线条没有..............

想做的更好...................
2007-4-28 14:53
卡洛
Rank: 2
等级:注册会员
威望:2
帖子:178
积分:1880
注册:2007-3-23

<table width="90%" border="1" cellPadding="0" cellSpacing="0" style="border-bottom-color:#cfcfcf; border-left-color:#cfcfcf;border-right-color:#cfcfcf;">

你这里少了top那条线。当然没咯``

2007-4-28 14:55
benbenmeng
Rank: 1
等级:新手上路
帖子:14
积分:240
注册:2007-4-27
回复:(卡洛)

知道 ,但是那个table在geidview内是重复的,要是加了的话,第一个底部和第二个的顶部就重复了,显的很粗,所以想问有没有办法补救那个最上面的线条啊

想做的更好...................
2007-4-28 16:25
卡洛
Rank: 2
等级:注册会员
威望:2
帖子:178
积分:1880
注册:2007-3-23

<table width="90%" border="1" cellPadding="0" cellSpacing="0" style="border-bottom-color:#cfcfcf; border-left-color:#cfcfcf;border-right-color:#cfcfcf;">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderWidth="0px"
ShowFooter="true" CellSpacing="0" CellPadding="0" OnPageIndexChanging="GridView1_PageIndexChanging"
Width="100%"  AllowPaging="True" AllowSorting="True">
<Columns>
<asp:TemplateField>
<ItemTemplate>

<tr style="background-color:#dbdbdb;" valign="top">
<td style="width:10%;height:20px">登记人</td>
<td style="width:40%;" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"Writer")%></td>
<td style="width:10%;">登记日期</td>
<td style="width:40%;" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"WriteDate")%></td></tr>
<tr><td style="width:10%;height:50px" align="center">日志信息</td>
<td colspan="3" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<%#DataBinder.Eval(Container.DataItem,"WriteInfo")%></td></tr>

</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</table>

那你这样改咯。有重复数据让他自动添家 TR就可以了。

2007-4-28 16:29
benbenmeng
Rank: 1
等级:新手上路
帖子:14
积分:240
注册:2007-4-27
回复:(benbenmeng)回复:(卡洛)



我试了,就变成上面这样了,呵呵,郁闷,还有高招没???
谢谢回复哦...........
附件: 只有本站会员才能下载或查看附件,请您 登录注册

想做的更好...................
2007-4-30 11:08
从小到大
Rank: 3Rank: 3
等级:中级会员
威望:2
帖子:200
积分:2100
注册:2006-6-24

直接写个控件 循环显示就可以了 我是这样做的


2007-4-30 20:28
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.059875 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved