这个效果怎么实现

wx8849 2010-04-13 10:40:31
http://hi.csdn.net/attachment/201004/13/2703431_1271126153PZFx.jpg


如图:需要用滚动条的方式显示这个checkboxlist里面的数据~默认显示3行,每行15个城市~剩下的随着滚动条的滚动显示~

就是怎么在checkboxlist上面实现滚动条
...全文
90 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
libinlink 2010-04-13
  • 打赏
  • 举报
回复
拷贝直接能用,刚好显示3行啦。。。。。。。。。。。。。。。
libinlink 2010-04-13
  • 打赏
  • 举报
回复
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div style="overflow-y: scroll; width: 150px; height: 140px">
<asp:CheckBoxList ID="cblGenre" runat="server" CellPadding="5" CellSpacing="10" RepeatColumns="6"
RepeatDirection="Horizontal" TextAlign="Right" RepeatLayout="Table" BorderStyle="Inset"
AppendDataBoundItems="true">
<asp:ListItem>ItemA1</asp:ListItem>
<asp:ListItem>ItemA2</asp:ListItem>
<asp:ListItem>ItemA3</asp:ListItem>
<asp:ListItem>ItemA4</asp:ListItem>
<asp:ListItem>ItemA5</asp:ListItem>
<asp:ListItem>ItemA6</asp:ListItem>
<asp:ListItem>ItemB1</asp:ListItem>
<asp:ListItem>ItemB2</asp:ListItem>
<asp:ListItem>ItemB3</asp:ListItem>
<asp:ListItem>ItemB4</asp:ListItem>
<asp:ListItem>ItemB5</asp:ListItem>
<asp:ListItem>ItemB6</asp:ListItem>
<asp:ListItem>Item1</asp:ListItem>
<asp:ListItem>Item2</asp:ListItem>
<asp:ListItem>Item3</asp:ListItem>
<asp:ListItem>Item4</asp:ListItem>
<asp:ListItem>Item5</asp:ListItem>
<asp:ListItem>Item6</asp:ListItem>
<asp:ListItem>Item41</asp:ListItem>
<asp:ListItem>Item42</asp:ListItem>
<asp:ListItem>Item43</asp:ListItem>
<asp:ListItem>Item44</asp:ListItem>
<asp:ListItem>Item45</asp:ListItem>
<asp:ListItem>Item46</asp:ListItem>
</asp:CheckBoxList>
</div>
</form>
</body>
</html>
vip__888 2010-04-13
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 wiki14 的回复:]
1.加个panel,把CheckBoxList放到panel里面,panel自带有滚动条
2.设置RepeatDirection属性
3.用CSS样式控制,如:

CSS code

style="overflow: scroll; left: 20px; width: 120px; position: absolute; top: 20px; ……
[/Quote]
这位MM写的很详细 了
kk5595 2010-04-13
  • 打赏
  • 举报
回复
sleepingsheepio 2010-04-13
  • 打赏
  • 举报
回复
被发现了~~不好玩儿
wx8849 2010-04-13
  • 打赏
  • 举报
回复
羊儿
KFCILIKEIT 2010-04-13
  • 打赏
  • 举报
回复
学习学习
sleepingsheepio 2010-04-13
  • 打赏
  • 举报
回复
奖个大头鬼哦!!!
wiki14 2010-04-13
  • 打赏
  • 举报
回复
1.加个panel,把CheckBoxList放到panel里面,panel自带有滚动条
2.设置RepeatDirection属性
3.用CSS样式控制,如:

style="overflow: scroll; left: 20px; width: 120px; position: absolute; top: 20px; height: 40px;"

4.重写Render方法
方法参照URL:
http://www.cnblogs.com/zsy/archive/2009/02/15/1160137.html
flyerwing 2010-04-13
  • 打赏
  • 举报
回复
把那个放到DIV里,然后给DIV用CSS控制高度及益处的属性估计能OK吧。
sleepingsheepio 2010-04-13
  • 打赏
  • 举报
回复
sleepingsheepio 2010-04-13
  • 打赏
  • 举报
回复
sleepingsheepio 2010-04-13
  • 打赏
  • 举报
回复
http://hi.csdn.net/attachment/201004/13/4297220_1271126701S72W.gif.thumb.jpg
wangwenjun0618 2010-04-13
  • 打赏
  • 举报
回复
帮忙顶、、、、、
  • 打赏
  • 举报
回复
应该设置好了,滚动条就会出现的吧
radiu7 2010-04-13
  • 打赏
  • 举报
回复
那我再顶一下
radiu7 2010-04-13
  • 打赏
  • 举报
回复
顶了真的有奖么?!

62,075

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧