Horizontal Grid with Multiple Columns
This example shows how to build a Horizontal Grid with Multiple Columns.
Steps to Recreate
- Use the Grid Builder to create the store_products grid.
- On Step 2 select image_url and product_name from 'Available field'.
- On Step 4 select the No sorting option and set Record Per Page to 9. This number should be divisible by the number of columns, which you would like to create.
- Change field type image_url to 'image'.
- Switch to the HTML Mode.
- Move label product_name into the table cell with the image, enter <BR> tag before it and then remove the empty cell.
- Move <tr class="Row"> before <!-- BEGIN Row --> and </tr> after <!-- END Row -->.
- Add panel RowSeparator right before <!-- END Row --> and enter the following HTML within the Panel block:
- Add label EmptyRow right after <!-- END Row --> before </tr>.
- Change colspan="2" to colspan="3" in the Navigator row.
- For both labels set the Content property to HTML.
- Add the appropriate programming code in the events as shown in the example.
- Make cosmetic changes as needed by modifying the text or captions within the HTML.
Database Tables Used
The grid Before Show Row event is used to add the Row Separator after each three columns.
The EmptyRow label's Before Show event is used to add missing cells to the last row, if the number of rows is less then three.