andy
Posts: 183
|
| Posted: 04/27/2010, 2:27 AM |
|
Not sure you can have a listbox appear as a multi-column grid out of the box without using a third-party library, but what you can do is to concatenate fields from one or more tables and display them in the drop down box.
In the Data properties of your listbox set:
Data Source Type: SQL
Data Source: [Enter your custom SQL query here (see example below)]
Bound Column: the value to be stored in your database
Text Column: the value to be displayed in the listbox
Here's an example of a custom SQL query that in this case concatenates 2 fields from the same table (name and vatrate) and displays them with the vat rate in brackets after the name with % at the end e.g. EC (15%).
I then set my bound column to "vatcode_id" and my Text column to the alias "2cols".
SELECT
vatcode.vatcode_id,
concat(vatcode.Name," (",vatcode.VATRate," %)") AS 2cols
FROM vatcode
ORDER BY
vatcode.Name ASC
Obviously you have to do your SQL query to suit but you can separate values with various brackets or | or :: to show that they are different fields. I'm not sure you can align them in columns though.
You can also join tables or use views to extract data from different tables to join fields from different tables.
Hope that helps.
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |