我已经尝试了以下代码,但它不起作用。请帮助我找到解决方案。
源代码:
CheckBoxList chklstProducts = new CheckBoxList();
chklstProducts.DataSource = lstProduct;
chklstProducts.ID = "chklstProducts" + (i + 1);
chklstProducts.DataValueField = "ProductID";
chklstProducts.DataTextField = "ProductName";
chklstProducts.DataBind();
cell6.Height = 20;
提前致谢
最佳答案
需要用CSS来实现checkboxlist的垂直滚动。你只需要将你的列表包装在这个 div 中
<div style="width:200px; height:300px; overflow-y:auto">
// Checkbox List
</div>
关于asp.net - 在后面的 Asp.net 代码中为复选框列表设置滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16875953/