Use the XPView component, add the required properties to it, and set the properties' Group attribute to True.
This example requires a Northwind demo database on a local SQL Server. It demonstrates how to fetch distinct company names from the Orders table.