Changing the Layout of List Controls

Up to this point, you've seen how to manipulate list control selections, create and remove items programmatically, as well as how to bind these controls to external data sources. Now we'll look at how to control the layout of the two list controls that support this feature, CheckBoxList and RadioButtonList.

Using RepeatLayout

The first tool at our disposal for changing the layout of these two list controls is the RepeatLayout property. This property has two possible values: Table (default) and Flow. When RepeatLayout is set to Table, the list items are rendered within a <table> so that the items are distributed evenly. When set to Flow, the list items flow according to the surrounding HTML on the page. Listing ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.