1. General information
1.1. Description of the control
DataGrid is a view table that displays database records retrieved by a query from a database, with the possibility search and filtering records, and with the ability to export and import data.
A view table can also be placed in portlets on the main page, where it is displayed in a simplified form – without search, filters and the details panel, and without the time span set in the database query. A detailed description is provided in the separate guide Portlets.
1.2. Create a new control
A new datagrid can be created as follows from the view page using the toolbar with controls:
- First, clicking the mouse on the view page determines the position where the new datagrid should be placed. This will highlight the selected position with a gray horizontal line. Then just click on the “DataGrid” item in the toolbar of the view page, fill in the attributes of the new control in the newly opened dialog, and then save. This will insert a new datagrid at a pre-selected location on the view page.
- If the desired position is not determined before inserting a new datagrid, the new datagrid will be inserted at the end of the view page.
1.3. Edit or delete a control
- For each existing control, a pencil icon appears to the left of the control page to change or delete the control's settings.
- Individual controls can be moved vertically on the view page using the Drag&Drop method. Moving consists of grabbing the control, preferably behind its name, and then dragging it to the desired location on the view page.
- Controls can be moved only with the “Drag & Drop” or “Multi Drag & Drop” check box located above the toolbar with controls selected. For security reasons, these check boxes are cleared after each login to the application, so that a control is not moved by accident.
- With the “Multi Drag & Drop” check box selected, a check box is displayed next to the controls instead of the pencil icon. Controls marked with the check box are moved together with the dragged control and keep their mutual order.
2. List of tabs in the control settings dialog
- General – Setting general properties
- View table – View table column settings
- Details – Settings for columns displayed in details
- Search – Search settings
- Rights – Rights settings
- Administration – Setting other properties
2.1. “General” tab
2.1.1. Common query

2.1.2. Name
- The name of the control displayed in the header of the view table.
- Placing the control name between two pipes ensures that the view table is completely hidden if no record is the result of the query – for example “|Records in the Book table|”. The view table is hidden in this way only in user mode.
- The right side can be followed by alternative HTML code, which will be displayed instead of the view table if no record is the result of the query – for example “|Records in the Book table|<img src="Images/Help.gif">”.
- The suffix “++” at the end of the name merges, in the view table, the cells of consecutive rows of the same record that have the same value. The suffix “+++” merges the cells of consecutive rows that have the same value in the first column of the view table and in the further columns within its range, and shows the value of the first column in bold. The suffix applies only to a common query when the view table displays more than one record per page, and only for a common query is it hidden from the name – for an aggregation query it remains in the name. If the name is also placed between pipes, the suffix belongs inside the pipes – for example “|Records in the Book table++|”. The text after the right pipe is always taken as alternative HTML code.
2.1.3. Dictionary
- The dictionary lists the names of other controls, forms, view pages, categories, applications, application groups, and database query columns and headers used across the entire NET Genium installation.
- The dictionary search is used to design the correct control name and to maintain the consistency of the nomenclature throughout the application so that controls with the same meaning located in different places in the application are named in the same way.
2.1.4. Width
- The width of the control, expressed in pixels.
- If this input field is not filled in, the width of the view table will be determined automatically by the web browser.
2.1.5. Data source
- The data source defines the source database records displayed in the view table.
- Data source settings are made in the graphical designer of database queries. A detailed description of the database query designer is provided in the separate guide Database query designer.
- The display of the view table is also affected by some entries in the notes of the database query. A detailed description is provided in the separate guide Database query designer.
2.1.6. Options
- Show the “New record...” icon
- Checking this box determines whether an icon should be displayed in the header of the view table, which redirects the user to a specific edit form in order to create a new record in the database.
Details
- When a new view table with a common query is created with this box checked, a Space control with a horizontal line and a “New record” button that opens the edit form of the database query are inserted below it on the view page as well, and both controls get the same rights as the view table.
- Deny customization
- Checking this box determines whether individual users should be disabled from changing the column settings of this view table.
- Allow data import
- Checking this box determines whether an icon should be displayed in the header of the view table, which will allow data to be imported into the displayed database table from format files.
- XML
- XLS, XLSX, XLSM (Excel)
- CSV (Excel) – values separated by a semicolon and column names in the first row, i.e. the format created by the data export to CSV. Rows must end with the CR LF characters. A file whose rows end only with LF is read as a header alone without data, and the import saves no record. The encoding is recognized only by the BOM (UTF-8, UTF-16) – a file without it is read in the default code page of the server, so characters with diacritics are corrupted in a UTF-8 file without a BOM.
- MDB (MS Access) – the Microsoft Jet 4.0 or Microsoft ACE 12.0 OLE DB driver must be available on the server
- ZIP – an archive containing a file in one of the above formats. Only the first file of the archive is processed and the others are not extracted. Folders are skipped and a file stored in a folder is extracted without it.
Details
- If the first file of the archive is larger than 1 GB after extraction, the import rejects the archive.
- The import does not run the save scripts of the edit form and does not queue the records for synchronization, but the change history is written unless the edit form has it disabled. Allowing the import gives the user the same options as an administrator: importing by the ID column updates existing records or creates them with the given ID, and the link to the parent record (PID, PForm) and “Read-only” controls can be imported as well.
- The import runs in a dialog in three steps: selecting the file, selecting the table (for an MS Excel file, the sheet and the header row) and assigning the columns of the file to the controls the user has rights to. As long as no column has been assigned manually, the columns of the file are assigned automatically by matching the name, the abbreviated name or the identifier of the control. The ID, PID and PForm columns are not assigned automatically – if the import is to update existing records by the ID column, the ID column must be assigned manually, otherwise new records are created from the rows of the file.
- The “I am the owner of the imported data” option sets the importing user as the owner of the newly created records. Without it, the new records have no owner. When importing by the ID column, the owner is not set.
- The “ForeignKey values are IDs - deny ID lookup by imported value” option stores foreign key values as numeric identifiers. Without it, for each value a record is looked up whose value in the values query of the foreign key matches it, and only a value that is not found is converted to a number.
Details
- The icon is not displayed for a view table that reads data from a database view. Users with administrator privileges see it in every other row view table, even if this box is not checked.
- Attachments are imported only with their content (for example the XML format exported including attachments). In an XML file created by the data export, the automatic assignment of columns assigns the column with the attachment ID to a File or Image control, not the helper column with its content. The content of an attachment is therefore imported only if the “{column name} (Path + FileName + Base64)” column of a file exported in the “Data + Attachments (XML)” format is assigned to the control manually. Importing an attachment by the path to a file on the server or by the ID of an existing attachment is reserved for users with administrator privileges. The path must lead into the NET Genium installation directory unless the import is run from the local computer.
- A value that cannot be converted to a number of the given data type (for a foreign key and an integer data type also a decimal number or a number out of the range of the type) is stored as 0 both in a foreign key and in a control with a numeric data type, and an unrecognized date is stored as an empty value.
- Without importing the ID column, the link to the parent record (PID, PForm) is written only from the columns of the file assigned to it. Otherwise the new records have no parent record. When the ID column is imported, PID and PForm are also written only from the columns of the file assigned to them. Without them, they remain unchanged in existing records and empty in new records (database value “null”), so the “Hide nested records” option hides such records as well. A row with an empty or non-numeric ID creates a new record with a new ID. A negative ID or PID and, for an edit form with an Integer primary key, an ID or PID greater than 2,147,483,647 end the import with an error.
- Each row is saved separately. An error in a row ends the import, and the rows saved before it remain in the database.
- Checking this box determines whether an icon should be displayed in the header of the view table, which will allow data to be imported into the displayed database table from format files.
- Allow MS Excel import
- Checking this box determines whether the “MS Excel Export/Import...” icon should be displayed in the header of the view table. After clicking the icon, the options “Export data” and “Import data” are shown, allowing data to be exported to an MS Excel file or imported into the database table using an XLS or XLSX file. The exported XLSX file is prepared for a re-import – it contains a hidden row with the column identifiers and a hidden column with the record ID, it writes foreign key values as IDs of the referenced records, and it does not include ID columns, password columns, attachment columns or encrypted columns. If “Deny data export” is checked, only the import is offered.
- Without the “All columns” option, the exported file contains the columns of the view table as customized by the user. With the “All columns” option, it contains all database controls of the table that the user has rights to and whose value is displayed to all users, plus the “(PID)” column, which the import ignores. If “Deny customization” is checked, users without administrator privileges cannot select the option.
- The import only updates existing records. A record is looked up by the hidden column with the record ID in the whole database table regardless of the query condition and the filters of the view table, so records that the view table does not display are updated as well. Rows without an ID or with the ID of a record that does not exist, as well as records the user is not allowed to modify, are skipped. If no row of the file can be used to update a record, the import ends with the message “No records were found to be imported from Excel to NET Genium.” Only the sheet that is active in the workbook (the one selected when it was saved) is processed, the data is read from the third row, and only from the columns whose identifier is listed in the hidden first row. A value that cannot be converted to a number of the given data type (for a foreign key and an integer data type also a decimal number or a number out of the range of the type) is stored as 0 both in a foreign key and in a control with a numeric data type, and an unrecognized date is stored as an empty value.
- Unlike “Allow data import”, the import runs the save scripts of the edit form and queues the records for synchronization, and the change history is written unless the edit form has it disabled. Each row is saved separately: an error in a row ends the import and the message states the row number. The rows saved before it remain in the database. If only the “OnAfterSave” script ends with an error, the row at which the error occurred remains saved in the database as well.
- This feature is only available for view tables that do not use joins and do not read data from a database view.
Details
- Values of RichTextBox, MultiListBox, File and Image controls, of “Read-only” controls, of controls the user has no rights to and of controls whose value is visible only to the owner or co-owner of the record are not imported.
- Deny data export
- Checking this box hides the icon in the header of the view table that allows the displayed data to be exported to files. The denial is checked on the server as well. Users with administrator privileges can still export data. A detailed description of data export from DataGrid is provided in a separate guide DataGrid data export.
- Deny opening records
- Checking this box determines whether all users should be denied access to the edit form to open the displayed database record using the pencil icon that appears at the beginning of each row of the view table.
- Allow multiple assignments
- Checking this box determines whether a control for changing the value (a text box, a drop-down list or a check box, for TextArea and RichTextBox controls usually a link that opens a window for changing the value) should be displayed in the view table instead of the control value itself, with the option to change the value without opening and editing the record in the edit form.
- This function is applied only to controls that have the “Allow multiple assignments” check box selected on the “General” tab.
Details
- For a view table that reads data from a database view, this box does not apply – values cannot be changed in a cell or by the “Assign value...” item.
- If a control has “DENYCONTROL()” in its “Notes” field, the view table displays only its value, without the option to change it.
- An anonymous user may change a value directly in a view table cell under the same conditions as a logged-in user – a check box always, other controls according to the editing rights of the record. All anonymous visitors share one user account, so a record created by one of them is their own record for the others.
- For changing a value directly in a cell, the editing rights of the record are evaluated when the view table is displayed. A change of the record owner or of the editing rights made after the table was displayed applies when the table is displayed again. In a table displayed earlier, the value in a cell can still be changed until the end of the user's session.
- Checking this box determines whether the “Assign value...” item should be available in the drop-down list of individual column filters, which is used to assign a value to all marked or filtered records in the view table.
- This function is applied only to controls that have the “Allow multiple assignments” check box selected on the “Filter” tab.
- If specific records are marked in the view table, only the selected records will be assigned a value. If no records are marked, all filtered records will be assigned a value.
Details
- Column filters, and therefore also the “Assign value...” item, are available to an anonymous user as well. All anonymous visitors share one user account.
- If the column belongs to a joined edit form, the value is assigned to the records of the joined form in all view table rows whose record is marked, or in all filtered rows – for a join in which several joined records correspond to one record, therefore to all joined records of the marked record. The right to change a record is evaluated according to the joined form.
- Assigning a value and deleting work over the whole condition of the view table, i.e. also over records that are not displayed in the table because of the “Load only first” setting or because only one page of records is loaded when “Show search results only” is checked without “Load only first”.
- Marking of records persists when switching to another page and when the filters or the search term change. The user cancels it by hiding the check boxes with the “Mark records...” icon or by opening the page again. Assigning a value and deleting process only those marked records that meet the current condition of the view table (search term, column filters and composed filter). The other marked records are skipped without any message. The number of records in the confirmation before a value is assigned and the limit of 1,000 records for deletion, however, include all marked records.
- If no records are marked, the records to which a value is assigned or which are deleted are selected by a database query in which the matching of the search term, the column filters and the composed filter is decided by the collation of the database. For displaying the table, the column filters are always evaluated only on the records already read, and so is the search term unless “Show search results only” is checked, so the filtered records may differ from the displayed ones. Before a bulk operation, it is therefore safer to mark the records.
- If the control has the “Required field” box checked, an empty value cannot be assigned to it.
- If a single value (not its negation, a comparison or a search text) is selected in the filter of the column to which a value is assigned, the filter is set to the assigned value after the assignment, or to “All” when an empty value is assigned. If the column is a ForeignKey control, the filters of all columns that belong to an edit form other than that of this control are also set to “All”. The changed filters are saved to the individual settings. For an anonymous user they are not saved.
- The “OnBeforeSave” and “OnAfterSave” scripts of the edit form are run for each record separately when a value is assigned only for a control that has the “Run OnBeforeSave/OnAfterSave before the record is saved to the database” box checked. For other controls, the value is assigned without running the scripts.
- If “Show search results only” is checked, a value cannot be assigned and records cannot be deleted without an entered search term or composed filter.
- Checking this box determines whether the “Delete records in the view table” icon should be available in the view table header, which is used to delete marked or filtered records in the view table.
- Users with administrator privileges – if specific records are marked in the view table, only the marked records will be deleted. If no records are marked, all filtered records will be deleted! At most 1,000 records can be deleted at once. Only the built-in “Administrator” account deletes without this limit.
- Users without administrator privileges can only delete marked specific records, they do not have permission to delete all filtered records.
Details
- Records the user is not allowed to delete and records whose deletion is rejected by the “OnBeforeDelete” script with an error are skipped, and their number is displayed in a message after the deletion. An error of the “OnAfterDelete” script is counted among the errors as well, even though the record has already been deleted. A record whose deletion the script skips with the SKIPDELETE() function is not deleted and is not counted in the message.
- Users with administrator privileges see the icon in every view table with a common query that does not read data from a database view, except for a view table in a portlet on the main page and in the picker.
- All filtered records are deleted only when the check boxes for marking records are not displayed in the rows. If they are displayed and no record is marked, a user with administrator privileges sees the message “No records selected.” and nothing is deleted. To delete all filtered records, the check boxes have to be hidden with the “Mark records...” icon.
- Before the deletion, a user with administrator privileges is asked whether the “OnBeforeDelete” and “OnAfterDelete” scripts should be run on the deleted records. For a user without administrator privileges, records are always deleted one by one with these scripts run. System records are never deleted.
- For a regular user, the icon is displayed with the label “Delete selected records”. The user sees it also when only “Activate marking records” is checked, and does not see it if the edit form has the “Delete” button hidden or if the view table reads data from a database view. A regular user can delete at most 1,000 records at once, only those the user is allowed to change, and only if the user has permission for all database controls of the edit form, or if the “Always allow deleting to the owner or co-owner of the record” option is enabled in the “ActionButtons” control of the edit form. Otherwise none of the marked records is deleted. A detailed description of the permissions to delete a record is provided in the separate guide Edit form.
- Checking this box determines whether the “Mark records...” icon should be available in the view table header, which is used to mark individual view table records in order to delete them or assign a value using a filter.
- The list of marked records – primary key values (column “id”) separated by a semicolon – can be accessed using the variables “#datagrid1#”, “#datagrid2#”, “#datagrid3#”, etc. in the script. The index indicates the order of the view table on the view page.
- Checking this box determines whether a control for changing the value (a text box, a drop-down list or a check box, for TextArea and RichTextBox controls usually a link that opens a window for changing the value) should be displayed in the view table instead of the control value itself, with the option to change the value without opening and editing the record in the edit form.
- Activate marking records
- Checking this box determines whether a check box should be automatically displayed at the beginning of each row of the view table to mark a record in order to delete it or assign a value using a filter, without using the “Mark records...” icon located in the view table header.
- The list of marked records – primary key values (column “id”) separated by a semicolon – can be accessed using the variables “#datagrid1#”, “#datagrid2#”, “#datagrid3#”, etc. in the script. The index indicates the order of the view table on the view page.
- Checking this box determines whether a check box should be automatically displayed at the beginning of each row of the view table to mark a record in order to delete it or assign a value using a filter, without using the “Mark records...” icon located in the view table header.
- Show sums of columns
- Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the view table.
- This function is applied only to TextBox controls of numeric, currency and time data types and to AutoSum controls that do not have the “Hide the sum of the column in the view table” check box selected on the “General” tab.
- Hide nested records
- Checking this box determines whether the “PID = 0” constraint should be automatically appended to the database query definition. Records whose PID is not filled in (the database value “null”) are therefore hidden as well.
2.1.7. Aggregation query without grouping by date
- Deny data export
- Checking this box hides the icon in the header of the view table that allows the displayed data to be exported to an XLSX file. The export runs without the export dialog. Users with administrator privileges can still export data.
- Show sums of columns
- Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the view table.
- This function is applied only to columns that do not use the command to hide the sum of the column using the syntax “Column@-sum”. A detailed description of the syntax of column names is provided in the separate guide Database query designer.
2.1.8. Aggregation query with grouping by date
- Deny data export
- Checking this box hides the icon in the header of the view table that allows the displayed data to be exported to an XLSX file. The export runs without the export dialog. Users with administrator privileges can still export data.
- Fill time gaps
- Checking this box determines whether missing periods should be added to the resulting data set in the column according to which the data is grouped. Periods are added between the first and the last period found for each grouping value, not up to the limits of the time span. The numeric columns of the added rows are set to “0”, the grouping value is taken over and the text columns remain empty.
Details
- In the added rows, cumulative columns hold the running value of the cumulation and expression columns (including columns of the “Text” type with an expression) are evaluated in the same way as in the other rows. The other numeric columns hold the value “0” and date columns remain empty.
- Pivot table
- Checking this field determines whether the view table should write the data out as a pivot table – the grouping values in the rows and the individual periods in the columns.
- The field applies only to an aggregation query with grouping by date that also has the grouping columns filled in and has no custom multi-row header. Otherwise it has no effect.
Details
- If “Show sums of columns” is checked as well and the table contains more than one period and at least one non-cumulative column of a count, sum, average, maximum or minimum without the syntax “Column@-sum” or an expression column that is summed in the summary column or a cumulative column with the syntax “Column@+sum” (see below), a summary column “Σ” is added after the period columns – for a count and a sum it holds the sum of all periods, for an average the average per period, and for a maximum and a minimum the highest or lowest value. For a maximum and a minimum, periods in which the group has no record are skipped. For columns with the syntax “Column@-sum” the summary column remains empty. If all columns have this syntax, the summary column is filled in and only the totals row is hidden. Cumulative columns remain empty in the summary column. With the syntax “Column@+sum” (for example “Balance@+1+sum”) they hold the final state in it – the value of the last period in which the group has a record, for the cumulation “-1” and “--1” of the first such period (the other way round if the query is sorted in descending order by the date by which it is grouped). An expression column with the NGEF, SQL or SQLTABLE function in the expression or with a reference to the date by which the query is grouped and a non-cumulative column with the syntax “Column@+sum” (also a maximum or a minimum) are summed over all periods in the summary column (with this syntax, an average is still divided by the number of periods). Other expression columns are evaluated in it over the values of the summary column.
- In a pivot table, a row of the query result is a combination of a grouping value and a period, so a column condition (the fourth part of the column name) does not remove a whole table row (the row disappears only if none of its periods matches the condition), only the non-matching period: its cells remain empty in the row, a period in which no grouping value matches the condition is not displayed as a column, and the summary column “Σ” sums only the remaining periods (an average, however, is divided by the number of all displayed periods, so a removed period counts as 0).
- Clicking the header of a period displays only that period and marks its header with the text “(Active)”. The same applies to the header of the summary column “Σ”. Clicking it again displays all periods again. Selecting a period or cancelling the selection resets the sorting of the table to the default. The selected period stays selected in the user's individual settings, also the next time the view table is displayed, until the user cancels it by clicking again. If the selected period is missing in the data, all periods are displayed and the selection is cancelled by the next action in the view table. In a portlet, the selected period is not saved.
- Periods in the columns are always ordered from the oldest to the newest, even if the query is sorted by date in descending order. In a pivot table, the default sorting by a column whose fourth part of the name (the condition) ends with “ASC” or “DESC” follows the values of this column in the first displayed period – if one period is selected, in the selected period.
- Show sums of columns
- Checking this box determines whether a row with the sum of the values of the individual columns should be displayed in the footer of the view table.
- This function is applied only to columns that do not use the command to hide the sum of the column using the syntax “Column@-sum”. A detailed description of the syntax of column names is provided in the separate guide Database query designer.
2.2. “View table” tab
2.2.1. Options
- Show upper navigation toolbar
- Checking this box determines whether a toolbar with icons for switching between pages should be displayed in the header of the view table.
- By default, this toolbar is displayed in the footer of each view table if the number of data displayed is greater than the number of records on the page.
- Show filters
- Checking this box determines whether the view table should allow filtering of database records.
- A filter is offered only for columns whose control has the “Show filter in the view table” check box selected. If no column of the view table has it, the filters are not displayed.
Details
- If a composed filter is set, the “Reset filters...” icon first resets only the composed filter, and the column filters are reset by the next click.
- A column filter offers the “All” item, which cancels the column filter, and usually also the values occurring in the column. For a check box it also offers the “Yes” and “No” items, for other controls the “Search”, “Blanks” and “Non-blank” items. For a foreign key and an attachment, the value 0 is also taken as blank. For a date column it offers periods instead of the values from the column, for example “This year”, “Last month” or “Today”. The “Search” item displays a box for entering a value: in a text column, a value containing the entered text matches, and a vertical bar “|” at the beginning or at the end of the text restricts the search to the beginning or the end of the value. In a numeric or date column, the filter also offers items for comparing with the entered value.
- If a value is selected in a column filter, the filter also offers the “! value” item next to it, which selects the records with a different or empty value, and in a numeric column also items for comparing with the selected value (“< value”, “<= value”, “>= value” and “> value”). The “Custom...” item opens the composed condition of the column filter. It is not offered for a check box, for an attachment or to the anonymous user.
- In a numeric or date column, a comparison with the prefix “<”, “<=”, “>” or “>=” can also be entered in the box of the “Search” item. In a text column, the prefix is ignored and the text after it is searched for. In a numeric column, a number without a prefix finds the values equal to the entered number. In a date column, a date, a date variable (for example #today#), a year, or a month and a year (for example “2026” or “3.2026”) can be entered – a year and a month with a year denote the whole period.
2.2.2. Columns
- Define the default settings of view table columns.
- For an existing control, the “...” link below the “Columns” label offers the “Import columns of user” item with the login name of the logged-in user, which selects the columns according to the user's individual view table settings. The default settings change only when the control is saved.
- The “(ID)” item adds a column with the ID of the record.
2.2.3. Records per page
- For clarity, the view table uses the paging of the displayed records. This is useful in situations where the view table is retrieving large amounts of data.
- The number of records per page determines the maximum number of records that appear on one page. It is easy to switch between the individual pages using the toolbar, which is contained in each view table in its footer, or optionally in the header.
2.3. “Details” tab
2.3.1. Options
- Show details
- Checking this box determines whether the view table should display the details of each record at the bottom of the view table.
Details
- If the box is checked, the view table search also covers detail columns that are not displayed in the view table. With optimized search, these columns get their own search box as well. This does not apply to columns whose value is visible only to the owner or co-owner of the record.
- Show tooltip
- Checking this box determines whether the view table should display the details of individual records in the tooltip when the mouse hovers over individual records.
Details
- The tooltip is not displayed on a mobile device.
- The values of controls cannot be changed in the tooltip, not even if the controls have the CONTROLINDETAILS() function in their “Notes” field. Nested view tables from the detail columns are displayed in the tooltip as read-only – without the possibility to open, create or mark a record and to assign a value. In a portlet, nested view tables are not displayed in the tooltip.
2.3.2. Columns
- Define the default settings for detail columns.
- For an existing control, the “...” link below the “Columns” label offers the “Import columns of user” item with the login name of the logged-in user, which selects the columns according to the user's individual details settings. The default settings change only when the control is saved.
- The detail columns may also include view tables (DataGrid and LiteDataGrid) of the source edit form. In the details panel they are rendered as a nested view table evaluated for the displayed record.
- The “(ID)” item displays the ID of the record in the details.
- The “-” item inserts an empty row between the detail columns.
Details
- The “-” item does not apply if no displayed row precedes it in the details or if the last displayed row is another separator.
2.4. “Search” tab
2.4.1. Options
- Activate search
- Checking this box determines whether a row with a search box and a “Search” button should be automatically displayed in the header of the view table.
Details
- On a mobile device with a small screen, the row is not displayed automatically. Regardless of this box, the row is displayed if a search term is entered or if saved templates of the composed filter exist for the view table.
- A detailed description of the syntax of the search term (spaces, quotes, connectives, vertical bar “|”) is provided in the separate guide Application usage basics. The way of searching in an individual column is determined by the “Search in the view table” box of its control. A column with the “CONTAINS (MSSQL Full-Text)” option is searched on an MS SQL Server database using the full-text index by whole words – a vertical bar at the beginning of a word finds words that begin with it, a vertical bar at the end of a word is ignored. On another database, such a column is searched in the same way as with the “LIKE (contains)” option. Checking such a column by clicking its check box unchecks the other columns of the table on any database. Columns checked after it are searched together with it.
- Optimized search
- Checking this box determines whether each column of the view table should have its own search box.
- A term entered in the box of a column is searched only in that column, and a record must match all filled-in boxes. Whether the search term is evaluated in the database or only on the records already read is determined by the “Show search results only” box.
Details
- A column box from which no search condition arises (typically text in a number or date column that cannot be converted to a number or a date) is skipped in the search and does not restrict the records. If no condition arises from any filled-in box, no record is found.
- Show search results only
- Checking this box determines whether the data in the view table should be displayed only when entering a search term.
- Searching regardless of diacritics is not set here, but on the individual controls using the “Search without diacritics” box.
Details
- This box also determines where the search term is evaluated. When it is checked, the search term becomes part of the database query and the search result is therefore decided by the collation of the database. When it is not checked, the records are read from the database without the search term and the term is evaluated on the records already read – such a search is case insensitive but accent sensitive, regardless of the database settings. The exceptions are controls with a full-text index on an MS SQL Server database, in which the search term is looked up by a database query in this case as well. For attachments (File and Image), the file names are read from the database and the search term is always evaluated in them on the records already read, regardless of this box and of the database settings. Only the content of the files is searched by a query to the full-text catalog (see Edit form – File). In this case, the column filters and the composed filter are also evaluated on the records already read. A composed filter with the #weekend# value, however, is evaluated in the database.
- The sorting of the view table is evaluated on the records already read as well, so it does not depend on the database settings either. When the number of loaded records is limited, however, which records are read in the first place is decided by the sorting in the database and, for text values, by the collation of the database. With “Show search results only” checked, the sorting is reflected in the database query only if the query has sorting set by a column other than ID. Otherwise an arbitrary part of the matching records is read, so it is advisable to set the sorting in the query.
2.5. “Rights” tab
2.5.1. Rights
- Rights define a list of user groups and users who have permission to display the control on the view page.
- For a new control, the rights are prefilled from the control at the position selected before inserting it or, if no position is selected, from the rights of the view page.
2.5.2. Replace rights to other controls
- The “Replace rights to other controls” feature is used to unify rights across the entire view page for controls that are related in terms of rights.
- Thanks to the “Show...” link, it is possible to display a list of all controls on the view page, including the setting of the rights of these controls. A check box is displayed for each control to select it. When the control is saved, the same rights are then set for the selected controls.
- An alternative for unifying rights within the entire view page is the overview of the rights settings of all controls, displayed by the “Show summary...” link on the “Rights” tab in the view page settings.
2.6. “Administration” tab
- The “Administration” tab is only displayed for existing controls.
2.6.1. Template name
- The template name is used to name the view table with the option to copy it when creating other view tables with the same source database table.
- When creating a new view table, it is first necessary to define the data source using a database query, and then all available templates are available in the “Templates” drop-down list next to the dialog buttons. The list is also offered in the settings of an existing view table. After selecting a template, all parameters of the view table will be automatically pre-filled with data from the selected template.
- A list of all view tables that are marked as templates can be displayed using a report. A detailed description of the reports is provided in the separate guide Reports.
2.6.2. Location
- Select the view page on which the control is located.
- The drop-down list contains the view pages located in the same application and in the same category as the view page on which the control stands. For a view page without a category, it offers only view pages without a category. For a new control, it contains only the current view page.
2.6.3. Other
- Change type to
- The drop-down list offers the types of controls to which conversion of the control is supported.
2.7. “Save”, “Save to all users”, “Copy”, “Delete”, and “Close” buttons
- “Save” button – Saves changes to the control settings together with the individual settings of the currently logged-in user.
- Individual datagrid settings can be opened using the gear-icon, which is available in the icon bar in the header of every datagrid.
- Individual datagrid settings include the following options:
- Options in the “General” tab of the individual datagrid settings
- “Sort by”
- “Records per page”
- “Show upper navigation toolbar”
- “Show filters”
- “Show grid”
- “Show sums of columns”
- “Show details”
- “Show tooltip”
- Column settings in the “View table” tab of the individual datagrid settings
- Column settings in the “Details” tab of the individual datagrid settings
- Options in the “General” tab of the individual datagrid settings
Details
- The columns on the “View table” and “Details” tabs and the “Records per page”, “Show upper navigation toolbar”, “Show filters”, “Show sums of columns”, “Show details” and “Show tooltip” options from this dialog are applied to the individual settings of this datagrid for the current user. The other individual settings of the current user, such as sorting, grid, search and the composed filter, are kept, but the values selected in the column filters are deleted. The settings of the current user for the portlet with this datagrid are deleted as well.
- All other users will retain their individual datagrid settings. If the “Deny customization” box is checked, their individual settings are deleted in the same way as by the “Save to all users” button.
- “Save to all users” button – Saves changes to the control settings and deletes the individual settings of this datagrid for all other users so that, upon the next display of the datagrid, the default settings defined in this dialog are applied. The settings of portlets with this datagrid are deleted for all users as well, and if the Administrator account has a composed filter template saved for this datagrid, the composed filter templates of the other users except the Administrator account are deleted too. The individual settings of the current user are modified in the same way as by the “Save” button.
- “Copy” button – Creates a new copy of the current control with identical settings, but with a newly generated unique identifier. Unsaved changes in the dialog are saved to the original control before the copy is created. The copy gets “ - Copy” appended to its name and its own copies of the database queries, scripts and rights.
Details
- If the changes in the dialog cannot be saved, no copy is created.
- “Delete” button – Permanently deletes the control.
- “Close” button – Closes the control settings dialog without saving changes.
3. Behavior of the view table
3.1. Loading data, paging and sorting
- The view table loads the whole result of the database query, and paging takes place only over the loaded data. The range of loaded data is limited by the “Load only first” setting in the database query designer.
- With a common query, the view table can be sorted by clicking a column header for columns of the TextBox, ComboBox, ListBox, Radio, CheckBox, ForeignKey, DatePicker and AutoSum controls. A ForeignKey column is sorted by the value stored in the database, i.e. usually by the ID of the referenced record, not by the displayed text. Clicking a column header sorts the table in ascending order by that column and cancels the second sorting. If the table is already sorted by that column as the first sorting (including the default sorting of the database query), the click only reverses the sort direction and keeps the second sorting. The “Default sort” button restores the sorting of the database query.
- If the aggregation query has columns of the “Filter” type, filters by these columns are displayed above the statistical view table. The selected value restricts the displayed data and is saved to the individual settings.
Details
- If “Show search results only” is checked and the query does not have “Load only first” set, at most as many records are loaded as set in “Records per page”. The view table then displays and exports at most one page of results.
- Records with a duplicate value (“Remove records with duplicate”) are removed only after the data is loaded, so the table may display fewer records than “Load only first” allows.
- For an aggregation query, the whole result is loaded and “Load only first” limits only the number of displayed rows, and only after sorting by the selected column. The totals row includes the rows above this limit as well. A detailed description of the “Load only first” setting is provided in the separate guide Database query designer.
- On a mobile device, tapping the header of a column that has a search check box in the displayed search row offers the items “Activate search” or “Cancel search” (checks or unchecks the column for search) and “Sort by”, which sorts the table by the column.
- If a statistical view table (other than a pivot table) is grouped by date as well as by further columns and sorted by the first grouping column, the values of the grouping columns are not written out in rows whose values of all grouping columns are the same as in the previous row, and the rows remain in the order in which the database query returned them.
- Without a valid license key, the row query of the view table is limited to 100 records, but a statistical view table is not limited. Licenses are not enforced in NET Genium Online, so records are not limited there even without a license key.
- A statistical view table displays 20 rows per page. The user can change the number of records per page in the paging toolbar, which is displayed if the table has more rows than fit on one page, and the change is saved to the user's individual settings. On a view page and in an edit form, a statistical view table has no individual settings dialog, no search and no filters in the column headers.
- A statistical view table can be sorted by clicking a column header, always by one column only. Clicking it again reverses the sort direction, and the selected sorting is saved to the individual settings. The default sorting is determined by the first column other than the grouping columns and the column grouped by date whose fourth part of the name (the condition) ends with “ASC” or “DESC”, for example “Count@@@DESC”. If no column has it, the table is sorted by the first column in the sort direction set in the database query designer. The “Default sort” button restores the default sorting and also resets the number of rows per page to the default (20, 10 in a portlet) and returns to the first page. A detailed description of the syntax of column names is provided in the separate guide Database query designer.
- In a portlet, the filters by columns of the “Filter” type are not displayed above the statistical view table.
- The filters by columns of the “Filter” type offer the same items as a column filter of a view table with a common query (see the “Show filters” box), including the “Custom...” item for a composed condition of the filter, but they do not offer the “Assign value...” item. For a date column, they additionally offer the items “Year ...” for the years in which the column has values and, after a year is selected, also the item “! Year ...”.
3.2. Column sums
- Sums in the footer are calculated from all filtered records, not only from the current page.
Details
- For an aggregation query, the totals row holds a value for each column according to its type: for a count and a sum the sum of the row values, for an average the average of the row values (an empty value counts as 0), for the maximum and minimum the largest or smallest value, where rows without a value are skipped (if no row has a value, the cell remains empty), for a cumulative column the sum of its last value in each group, or of its first value for the cumulation “-1” and “--1” (without grouping columns the value of the last or the first row), and for an expression column the expression evaluated over the values of the totals row – an expression column with the NGEF, SQL or SQLTABLE function in the expression or with a reference to the date by which the query is grouped is summed instead. A column with the syntax “Column@+sum” is summed as well, including a maximum, a minimum and a cumulative column. An average remains an average even with this syntax. The database returns the average of a whole-number column (for example a TextBox of the “Whole number” or “Big whole number” type) as a whole number, and the average is a whole number in the totals row and in the summary column “Σ” as well. Grouping, text and date columns remain empty in the totals row. The first column, however, holds the symbol “Σ” if it would otherwise be empty. A column with a displayed value (the third part of the column name) shows this value in the totals row as well. A detailed description of the column types is provided in the separate guide Database query designer.
- For a row query with 1,000 or more records, the sums are calculated by the database for speed, but only if the query has no external function and has not reached the “Load only first” limit. The database evaluates the search and filters by its own comparison rules (for example without distinguishing diacritics), so the sum may differ from the one calculated from the loaded data. If “Remove records with duplicate” is set in the query, the sums are always calculated from the loaded data.
3.3. Opening records
- A record is opened by the link at the beginning of the row and, in user mode, also by double-clicking the row. On a mobile device and in an installation with the “SimpleClick.txt” file in the “Config” directory, clicking the row is enough. If “Show details” is checked, clicking a row displays the details of the record and the record is opened by the link, by double-clicking or from the menu described in the Details panel chapter. Clicking a row selects the record even without the details panel: the Ctrl+Up arrow and Ctrl+Down arrow keyboard shortcuts then move the selection to the previous or next row, and, in user mode, Ctrl+Enter opens the selected record.
- “Deny opening records” only hides the links in the view table. Opening a record by the direct address of the edit form is governed by the rights of the edit form.
- If ID is the first grouping column of an aggregation query, a row of the statistical view table carries a link that opens the record. The ID column is not included in the export.
Details
- Selecting a row without the details panel and the Ctrl+arrow and Ctrl+Enter keyboard shortcuts do not work where a record is opened by clicking its row, nor in a portlet or a picker.
- In a statistical view table grouped by date as well as by further columns, the rows in which the values of the grouping columns are not written out have no link (see the Loading data, paging and sorting chapter).
- Only the ID of the edit form on which the query is built carries the link. If the first grouping column is the ID of a joined edit form, it is written out as an ordinary value without a link and is included in the export.
3.4. Individual settings
- Individual settings (sorting, current page, records per page, search term, filters and columns) are saved separately for each user, with the database query of the view table.
- Except on a mobile device, the individual settings dialog (the gear icon) also offers the “Export/Import” tab. The “Export table settings” button writes the settings displayed in the dialog – sorting, records per page, the options on the “General” tab and the view table and details columns – into the “My settings” field, and the “Export search and filters” button writes the saved search term, the column filters and the composed filter. The “Import” button reads the text pasted into the field: table settings are taken over into the dialog, where they have to be saved with the “Save” button. Search and filters are saved directly to the individual settings together with the settings displayed in the dialog.
- For users with administrator privileges, the dialog also offers the “Save to more users” tab. The “Save to more users” button overwrites the individual settings of the view table for the selected user groups and users according to the dialog – sorting, records per page, the options on the “General” tab and, if the “Deny customization” box is not checked, the columns.
- The “Hide” icon in the header of the view table hides the data of the view table, and the “Show” icon displays it again. The state is saved to the individual settings and applies also the next time the view table is displayed. While the data is hidden, a value cannot be assigned and records cannot be deleted.
Details
- Individual settings are not saved for the anonymous user, who has neither view table customization nor the composed filter available. The exception is the selection of view table and details columns: it is saved for the anonymous account when the view table or its details are displayed for the first time and is shared by all anonymous visitors. After the default columns of the control are changed, the “Save to all users” button therefore has to be used. Column filters and the search selection in individual columns are also written to the anonymous account by the “LOADDATAGRIDSETTINGS” server function and cleared by the “RESETDATAGRIDSETTINGS” function. The change applies to all anonymous visitors.
- Columns to which the user has no rights are removed from the user's individual settings when they are saved.
- If a user saves a different selection or order of the view table or details columns in the individual settings dialog, the values selected in the user's column filters are deleted. When search and filters are imported with the “Import” button, the filter values are taken over from the imported text. The “Save to more users” button deletes the values selected in the column filters of the other selected users every time, unless the “Deny customization” box is checked.
- A view table placed on a tab of a view page does not offer the “Hide” and “Show” icons – it always loads its data when the tab is displayed.
- In NET Genium Online, a user with administrator privileges who saves individual settings (also with the “Save to more users” button) saves the default settings of the control at the same time, provided the user may change the control: the “Records per page”, “Show upper navigation toolbar”, “Show filters”, “Show sums of columns”, “Show details” and “Show tooltip” options and the view table and details columns are taken over. Sorting and the grid are not taken over into the default settings, and the individual settings of the other users are kept.
- “Show grid” is part of the individual settings only. The default settings of the control do not determine it. A statistical view table always displays the grid, except in a portlet.
3.5. Composed filter and values in the table
- On the “Templates” tab of the “Composed condition” dialog (only for the composed filter of the whole view table), the condition can be saved as a template under the name from the “Template name” field by checking the “Save as template...” box. The “Organize templates” field offers the templates the user has saved for the database query of this view table (other view tables over the same query share them). Their order and removal are saved together with the dialog. The dialog can be saved only with at least one condition, which is used as the composed filter at the same time – organizing or removing templates alone cannot be saved without a condition.
- With the “Save as template...” box checked, an administrator can check the “Save to more users...” box and select user groups and users. Each of them gets the template, and the condition is also saved for them as the composed filter of the database query of this view table – their previous composed filter is replaced.
Details
- Values entered into the composed filter are inserted into the condition literally. Server functions are not evaluated in them and only date variables (e.g. #today#, #now#) and the special values #random# and #weekend# are replaced. The #dayrandom# value always gives 0 in them. The #weekend# value works only in the composed filter of the whole view table. In a composed condition of a column filter (the “Custom...” item), it selects the records with an empty date.
- Conditions of the composed filter on columns to which a user without administrator privileges has no rights, or whose “Show value” property is set to “only to the owner or co-owner of the record”, are omitted for that user. The same applies to conditions that compare the value with such a column. A composed filter with more than 100 conditions is not applied at all.
- Composed filter templates that the Administrator account has saved for the database query of the view table are copied to every other user as the user's own templates when the user first displays a view table with a common query over this query, i.e. while the user has no individual settings saved for the query. The anonymous user does not get them. Templates the Administrator account saves later reach users with saved individual settings only after their individual settings are deleted (for example by the “Save to all users” button).
- A check box displayed in the view table can always be switched – even for a “Read-only” control and for a record of another user. Other controls can be changed in the view table only if the user is allowed to change the record and the control is not “Read-only”.
3.6. Details panel
- If “Show details” is checked, a panel with the details of the record whose row the user clicks is displayed below the view table.
- If the “Config\GoogleTranslationApiKey.txt” configuration file is filled in, the panel offers a logged-in user the “Translate...” icon for translating the displayed text using the Google Translation API. A detailed description of the configuration file is provided in the separate guide NET Genium settings.
- The value of a control can be changed directly in the panel if the control has the CONTROLINDETAILS() function in its “Notes” field. Whether the user may change it is decided by the same rules as in a view table cell. A detailed description is provided in the separate guide Server functions.
- Double-clicking the panel opens the displayed record in the same way as double-clicking its row, i.e. only in user mode.
- If the user clicks again the row whose details the panel displays, a menu with the items “Show details” (scrolls the page to the panel), “Modify record...” and “Open record in a new tab (in a new window)...” is displayed next to the row. On a mobile device, the menu is displayed after every click on a row.
- Clicking in the panel offers “Back” (returns to the row of the record), “Modify record...”, “Open record in a new tab (in a new window)...”, “Show link” (copies a link to the record to the clipboard), “Previous record” and “Next record”. The “Show link” icon is offered under the same conditions as the link icon in the upper right corner of the view page, described in the separate guide View page. The DISABLEPAGETOOLS() function in the notes of the page, however, does not hide it. It is not offered on a mobile device.
- The keyboard shortcuts Ctrl+Up arrow and Ctrl+Down arrow display the previous or next record in the panel. The up and down arrow icons in the panel do the same. On the first and the last row of a page, the shortcuts and the icons move to the previous or next page of the view table.
- The Ctrl+Enter keyboard shortcut opens the selected record in the same way as double-clicking its row. In an edit form with the “Save” button, it saves the edit form instead.
Details
- When the view table is loaded, the panel displays the record displayed last. If this record is not on the current page of the view table, the record that was in the row above it is displayed, and if that one is not there either, the record from the first row.
- The record displayed last is saved for each user separately. It is not saved for the anonymous user.
- A record opened from the view table in the same window (not a record opened in a new tab, nor from a nested view table in the panel) is saved as the record displayed last as well, so the panel displays it the next time the view table is loaded.
- The panel omits columns with an empty value, but a check box is always displayed. If nothing is left to display after the empty values are omitted, the panel is hidden.
- The DENYCONTROL() function in the “Notes” field of a control prevents changing the value only in a view table cell. It does not apply in the details panel.
- A nested view table from the detail columns is displayed in the panel in a simplified form – without search, filters, grid, icons in the header and its own details panel, and without the possibility of switching pages or sorting the table by clicking a column header. A record can be opened from it only if the record of the parent view table can be opened. The “Hide data source” box does not apply to it in the panel or in the tooltip – the data is loaded immediately.
- Both menus are displayed only for a record that can be opened from the view table, and not when text is selected on the page. They are not displayed in the picker or in a portlet.
- On a mobile device, neither menu offers the “Open record in a new tab (in a new window)...” item.
4. Examples
4.1. Javascript functions
- dg_Disable();
- dg_Enable();
- dg_HideColumn(DG123, 456);
- dg_HideColumn(el(DG123), 456);
- dg_HideHeader(DG123);
- dg_SearchColumns(DG123, [1, 2, 3]);
- dg_SearchColumns(el(DG123), [1, 2, 3]);
- dg_ShowColumn(DG123, 456);
- dg_ShowColumn(el(DG123), 456);
- dg_VisibleColumns(DG123, [1, 2, 3]);
- dg_VisibleColumns(el(DG123), [1, 2, 3]);
- var array = dg_Controls(el(DG123));
4.2. Variables
- #datagrid1#
- #datagrid2#
- #datagrid3#