Saturday, September 29, 2012

Changing the Number of Columns of a Check Box List

The Columns property can be used on a Check Box List lookup data field in order to change the number of columns that the check boxes will be presented in.

The Employees edit form below contains the Territories many-to-many field.

Territories Check Box List on the Employees form rendered in a single column

Note that all 53 Territories check boxes are presented in a single column – the form is excessively long. Let’s change the presentation into multiple columns.

Start the Project Designer. In the Project Explorer, switch to the Controllers tab and double-click on Employees / Views / editForm1 / c1 – Employees / Territories data field node.

Territories data field in 'editForm1' view of Employees controller.

Change the Columns property:

Property Value
Columns 5

Press OK to save. On the toolbar, press Browse.

Navigate to the Employees page, and edit a record.

Territories Check Box List on the Employees form rendered in 5 columns

The Territories check box list is now displayed in 5 columns flowing vertically. The presentation is more compact.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com