Hi persepolis,
A simple example is to consider the scenario of returning the page titles from the latest 10 items in the site_content table:
1. Create a new TV, keep the type as ’Text’. (give it name, caption, description as required)
2. In the default value, add in your @SELECT binding that will select the records from the database. In the example (assuming the table prefix is modx_), this is:
@SELECT pagetitle FROM modx_site_content ORDER BY id DESC LIMIT 10
3. Set the Output Type to ’Data Grid’.
4. In the Widget Properties, set the following properties:
Column Names = Page Title
Field Names = pagetitle
Leave the rest as the defaults (for the purpose of this example)
5. Assign the TV to the required templates.
6. Save the TV.
7. In your page, insert the TV where you want the Data Grid to be displayed.
Does that help? You can do a lot more with the Data Grids but it depends on your application. For more advanced uses, you could always create a snippet and then use the Data Grid API to generate the output.