If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

Control Bar

Last modified: August 20, 2024

Introduction

A control bar of a template grid, data grid, and reference set selector allows you to manipulate the objects displayed by means of buttons. By default, both grids will be created with Search, New, Edit, and Delete buttons in the control bar:

Data Grid Control Bar

The control bar can also include a number of selection options and spreadsheet export buttons, as well as microflow buttons for custom actions.

Control Bar Buttons

Most properties of control bar buttons are the same as properties of button widgets. For more information on button properties, see Button Properties.

Sections below describe the purpose of each control bar button and their specific properties if any.

Search Button

The Search bar toggle button (with default caption Search) opens or hides the search bar. It is only present if the Show search bar property of the grid is set to either With button (initially open) or With button (initially closed).

Add Button

The Add button can only be used in the reference set selector. With this button, the user can select objects that have to be added to the reference set selector.

Page

The Page property indicates the page that is shown to users after they click this button. The user can use this page to select objects that have to be added to the reference set selector. This page should contain a data grid, template grid, or list view connected to the same entity as the reference set selector.

You can use an existing page or you can generate the appropriate page by either:

  1. Right-clicking the add button and selecting Generate page….
  2. Selecting New for the page.

Both these options allow you to create a page which has the correct format for use by the add button. You can, of course, edit the page to meet your own requirements once it has been generated.

See the Show a Page section of On Click Event and Events Section. Note that select pages must have a pop-up layout.

Create Button

The Create button (with the default caption New) allows an end-user to create new objects in a grid or reference set selector.

Entity

The Entity property determines of which entity this button should create an instance. If the entity that is connected to the grid or reference set selector has no specializations, the page editor will automatically set this property for you. Otherwise, you will have to select one of the specializations yourself.

For example, you have an entity Vehicle and two specializations: Bicycle and Car. In a grid, when you select Vehicle as a data source, you have to specify whether a Vehicle, a Bicycle or a Car will be created when the Create button is clicked. You can even have three New buttons, one for each specialization.

Action Button

An action button is a button that can perform various actions, such as calling a microflow or opening a page. The Edit and Delete buttons are action buttons created by default in a data grid and template grid control bar. For more information on action buttons, see Button Widgets.

Remove Button

The Remove button is a button specific for the reference set selector. With this button the end-user can remove objects that have been added to the reference set selector. For more information on a reference set selector, see Reference Set Selector.

Select Button

The Select button confirms the choice of a row of a grid when it is used for selecting an object for a reference selector or reference set selector. For this reason, the Select button can only be placed on a grid in a page that is connected to a reference selector or to the Add button of a reference set selector.

Select All Button

The Select all button allows an end-user to select all objects in a grid or a reference set selector.

Selection Type

The Selection type property determines whether the Select all button should select the objects on the current page, or the objects on all pages:

Value Description
Select page (default) Clicking this button selects all objects on the current page.
Select all Clicking this button selects all objects.

Deselect All Button

The Deselect all button lets the user deselect all rows in the grid or a reference set selector.

Export to Excel Button

The Export to Excel button allows end-users to export the contents of the grid or the reference set selector to an Excel file.

Maximum Number of Rows

The Maximum number of rows property indicates the maximum number of rows that can be present in the data grid when exporting. It can be useful to prevent end-users from exporting large quantities of data, potentially placing a heavy load on the server.

Date Export Format

The Date export format property defines the format dates will be exported. The possible options are the following ones:

  • Date value (default) – date values are exported as real dates, so that it is possible to use Excel date functions like sorting
  • Text – date values are exported exactly as shown in the data grid

Export to CSV Button

The Export to CSV button allows end-users to export the contents of the grid or the reference set selector to a CSV file.

Decimal Separator

Decimal separator is a string used to separate the fractional part from the whole part in decimal values.

Default: .

Group Separator

Group separator is a string used to separate groups of digits in large numbers.

Default: ,

Delimiter

Delimiter is a string used to delimit values in the resulting CSV file.

Default: ;

Maximum Number of Rows

The Maximum number of rows property indicates the maximum number of rows that can be present in the data grid when exporting. It can be useful to prevent end-users from exporting large quantities of data, potentially placing a heavy load on the server.

Generate Excel Separator Hint

The Generate Excel separator hint property adds an extra line to the CSV file header that informs Excel what the separator character is. This solves compatibility issues with Excel and localization.

Use Grid Date Format

When Use grid date format property is enabled, the date format of the column is used. When this property is disabled, a format that is recognized by Excel as a date is used (yyyy-MM-dd).

Read More