ComponentOne Query 8.0
Customizing the DataSourceFields Collection

A special collection property, C1Query DataSourceFields enables you to customize the set of fields exposed to the end user in DataSource mode. It consists of Field objects. If the DataSourceFields collection is empty at startup time or on setting the DataSource property, it is filled automatically with Field objects retrieved from the DataSource recordset. If you need to perform this action in code, retrieve fields from the DataSource recordset and fill the DataSourceFields collection, call the RetrieveFieldsFromDataSource method.

Modifying the DataSourceFields collection changes the selection of fields available to the end user in the attached C1QueryFrame controls. Field.FullFolderName determines the name by which the field is exposed to the user. Field.DataSourceName determines the field in DataSource to which this field is associated. Setting these properties in code allows you to rearrange the fields order and even associate more than one field with a single DataSource field. It is also possible to hide a field from to the user, setting its DataSourceFields property to empty string. In this case the read-only property Field.Exists is set to False.

The Alias property determines the name by which this field appears in the generated Filter condition or in the SQL WHERE condition. By default, it is the same as Field.FullFolderName.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback