BPC-Components

Home > Products > BPC PowerForms - Silverlight > Knowledge Base > Controls > The ListAndForm control

The ListAndForm control


​The ListAndForm control is suitable for implementing interactive Master-Detail views inside a PowerForm, as it helps you to create a fully functional subform inside a form. It contains 2 controls, a list query datagrid and a subform enriched with New/Edit/Delete buttons.



First of all a list query should be created at the Parent List. If you want to connect the query with an existing control, you should fill in the Criteria field during the List query creation. eg Title;{c_Title};Equals;Text



IMPORTANT: In order for the control to work as expected, you will have to include the ID column in your list query.

Then we add the ListAndForm control and we assign the list query to it. Now a datagrid is populated with the data provided by the list query and  a new subform is opened that gets detailed data from each row of the datagrid.

This new subform is just a form in the Parent form. It has its own designer, buttons, options etc. as all PowerForms. It is fully customizable. You can hide some controls, disable others, hide buttons(New, Save, Delete).

If you want to keep these customizations only for the subform, you should fill in a new condition in the Options>General Settings>Condition field that looks like ParentList() = "Parent List Name". Now the saved customizations for the subform will load only if this form is contained in the specified parent form.



You can also connect the form controls with some fields in the subform by providing default values to these fields using the Extra configuration. 

When a new record is created in the subform, the default value of the Title field will be inherited by the value of the Title control of the parent form.

 

There are also some other choices you can set in the subform's extra configuration :

Showfilter=True
A Combobox appears above the datagrid which helps you to filter the data.

Filters=Title;ID
It contains the fields that are used in the filter combobox

GridHeight=100
The height of the list Datagrid.

ShowGrid (True/False)
Determines if the grid will be visible or not.

AutoSelectFirst (True/False)
If set to True, the first record will be selected after data load.