vcl-171174-expressquantumgrid-tutorials-master-detail-tutorial-step-6-customizing-views.md
This section describes the steps required to customize the layout and the appearance of Views.
The result is shown below:
Similarly, hide the tvStaffID, tvStaffFilmID and tvStaffPERSONLINEID columns in the tvStaff View.
Hide the following columns for the tvPersons View: tvPersonsID, tvPersonsBIRTHCOUNTRY, tvPersonsLOCATIONOFBIRTH, tvPersonsBIRTHNAME, tvPersonsNICKNAME and tvPersonsHOMEPAGE.
In order to display the TAGLINE field in the preview section, set the properties of the tvFilms View to the following values:
Preview.Column to tvFilmsTAGLINE
Preview.Visible to True
The preview section in the following image is displayed in blue. Notice how it spans regular columns.
This hides the caption of the row:
This changes the size of View rows to fully display their contents.
set the column’s Width property via the Object Inspector
drag the column’s right edge. See the note below.
double-click the column’s right edge to set the width according to the contents of the column’s cells. See the note below.
Note
At design time, you cannot specify the layout of detail Views by moving/resizing their columns right on the form. Details on screen are represented by a number of clones created based on the pattern View (in our example, the tvStaff and cvFilmScreens Views are patterns). Expanding a specific master row in a master View (tvFilms) opens a detail clone created based upon the settings of the detail pattern View. So changing settings of a particular detail clone at design time is in no effect since clones will be recreated at runtime and any changes will be discarded. For detail Views, you have to use the Layout Editor. See the View Layout section for more information.
The following images show the result of View customizations.
You can click the ‘+’ button of a master row in the tvFilms Table View to access the detail tvStaff and tvFilmScreens Views. To switch between the Views, use the corresponding tabs (Staff and Film Screens). You can see that detail Views display information related to the selected master row.
To access the tvPersons View, click the Persons tab at the root level. It displays records from the PERSONS table. The data of the PERSONS table is independent of data from other tables used in this tutorial.
See Also