The GridPanel performs a secondary function in the Painter. In addition to acting as a container for objects, it has a special relationship with buttons, checkboxes, and radio buttons when they are added to a GridPanel.
Each object type shares the same characteristics in relation to its default Id and Attribute Name properties as follows.
Adding a Button Object to a GridPanel
When a button is initially added to a GridPanel, its default Id is Button1. It also creates a default attribute with the name Attribute 1. When a second button is added to the same GridPanel it receives a default Id Button2 but retains its binding with the attribute created by the addition of the first button, which is Attribute1. This continues for all buttons that are added to the same GridPanel.
Adding a Radio Button Object to a GridPanel
Adding a radio button to a GridPanel follows the same rules as adding a button object, with the exception that the default Id for each radio button is RadioButton followed by the number of the button. Each radio button is bound to the same attribute as the first radio button that is added.
Adding a Checkbox Object to a GridPanel
Adding a checkbox to a GridPanel follows the same rules as adding a button object, with the exception that the default Id for each checkbox is CheckBox followed by the number of the checkbox. Each checkbox is bound to the same attribute as the first checkbox that is added.
When moving a button or a checkbox from one group to another, the button is re-assigned to the attribute of the new group.
Value property of a Button or Radio Button
Though each button (or radio button) within a group is bound to the same attribute, each object maintains a different "Value" property. This allows the user to return a different value to the same attribute when the transaction is completed. One example of the use of this is where a GridPanel contains several buttons, each of which can return a different value to the MAINT field of an attribute when "clicked."
Checked and Unchecked Value Properties of a Checkbox
The value of a checkbox differs from other objects. Instead of the Value property, a checkbox has the Checked Value property that specifies a string value to be sent to the application when the object is checked and the form is transmitted at runtime. There is also an Unchecked Value property that specifies the value to be sent to the application when the control is unchecked. These properties are only available for a single checkbox; when there are multiple checkboxes, these properties do not exist.
Multiple checkbox objects within the same GridPanel are considered to be a group and are assigned to one attribute in the same way as buttons and radio buttons. At runtime, a representation of the state of the checkboxes in the group is sent to the application. For example, a representation of "1010" means the first and third checkboxes are selected and the second and fourth checkboxes are clear.
GridPanel Behavior
The behavior of Grid Layout Panel varies with the movement of objects in it. For example:
The behavior of the GridPanel varies with the movement of objects in it. For example -
In a GridPanel, you can change the location of objects by moving them. This changes the location of objects only in the GridPanel without disturbing the location of the GridPanel. To do this, select the objects in the GridPanel and move them. The GridPanel does not move but the objects within it move. However it might impact the size of the GridPanel.
Note: To select multiple objects, press and hold the Ctrl key.
In a GridPanel, if you move some of the objects out of the boundary, the GridPanel area expands to include all the objects. If you move some of the objects within the boundary, the location of the objects changes within the boundary without expanding the GridPanel area. The location of the GridPanel does not change.
In a GridPanel, when you try to move the objects out of the boundary, the boundary of the GridPanel is highlighted.