开发者

how to set the row number of row for checkboxlist in asp.net? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 2 years ago.

Improve this question

I have one checkboxlist with repeat columns=3. If the item count for the datasource of it is less than 20,i need to generate 20 rows with single column.If it is between 21 and 40 then 20 rows and two columns.if it开发者_如何学运维 is between 41 to 60 then 20 rows and 3 columns and for more than 60 records then as normal that checkboxlist behave. Any suggestion is appreciated.

Thanks Mohak


Try this:

int itemCount = <YOUR_DATASOURCE_ITEMS>.Count;
int columnCount = Math.Ceiling(itemCount/20.0)
<YOUR_CHECKBOX_LIST>.RepeatColumns = columnCount;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜