当前位置: 代码迷 >> ASP.NET >> 简单有关问题 马上给分
  详细解决方案

简单有关问题 马上给分

热度:4181   发布时间:2013-02-26 00:00:00.0
简单问题 马上给分
我自定义   CheckBoxList

CheckBoxList   CBL   =   new   CheckBoxList();
this.Panel1.Controls.Add(CBL);
从数据库读出字段后显示的是

[]a
[]b
[]c
这样的我想显示为[]a[]b[]c的格式


------解决方案--------------------------------------------------------
sql

declare @s varchar(1000)
select @s=@s+ ' '+字段名 from 表名

return @s
------解决方案--------------------------------------------------------
RepeatDirection属性设为Horizontal
------解决方案--------------------------------------------------------
设置this.checkedListBox1.MultiColumn = true;
this.checkedListBox1.ColumnWidth = 20;//每列的宽度
this.checkedListBox1.Size = new System.Drawing.Size(120, 20);//设置整个它的高度只能显示一行
------解决方案--------------------------------------------------------
看错了。。是WEB。。
那就设置RepeatColumns=读到的列数就可以了
  相关解决方案