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 of records, and with the possibility of data exports and imports.

1.2. Create a new control

1.3. Edit or delete a control

  • For each existing control, a pencil icon appears on the left side of the edit form to change or delete the control's settings.
  • Individual controls can be moved vertically in the edit form using the Drag&Drop method. Moving consists of grabbing the control, preferably after its name located in the left column of the edit form, and then dragging it to the desired place in the edit form.
  • Controls can be moved only with the “Drag&Drop” check box located above the toolbar with controls selected. For security reasons, this check box is cleared after each login to the application, so that a control is not moved by accident.

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
  • Help – Help text settings
  • Rights – Rights settings
  • Administration – Setting other properties

2.1. “General” tab

2.1.1. Common query

01-general-tab.png

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 displays a list of names of other controls, forms, view pages, categories, applications, and application groups used throughout the application.
  • 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 “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
      • Both the “New record...” icon and opening a record from the view table first save the record of the edit form in which the view table is placed – the JavaScript of the “Save” button, the validation and the “OnBeforeSave” and “OnAfterSave” scripts run, including the e-mails sent by the scripts. The icon always saves the record; when a record is opened, only the write to the database itself is skipped for an unchanged record of the form, and the scripts run anyway. Navigation scheduled in the save scripts is not performed, and if the validation fails, the nested record is not opened. If the user may not change the record of the form, the record is not saved and the scripts do not run.
  • 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 (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 entry of the archive is processed and the others are not extracted. The first entry must be a file located directly in the root of the archive – if it is a folder or a file in a folder, the import rejects the archive with the message “Invalid ZIP file!”
    • The import does not run the save scripts of the edit form and does not queue the records for synchronization; 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 new record that has not been saved yet, nor for a view table that reads data from a database view. Otherwise, users with administrator privileges see it in every 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 new records are nested under the record open in the edit form (PID, PForm); columns of the file assigned to PID or PForm take precedence. When the ID column is imported, PID and PForm are written only from the columns of the file assigned to them; without them, they remain unchanged in existing records and empty in new records, so the new records are not nested under the open record. 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.
  • 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, and regardless of the record open in the edit form, 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.
    • 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.
    • Unlike “Allow data import”, the import runs the save scripts of the edit form and queues the records for synchronization; 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.
  • 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 values in the view table under the same conditions as a logged-in user – check boxes always, other controls according to the editing rights of the record. All anonymous visitors, however, share a single user account and are therefore the owners of every record created by any of them. If the owner may change a record, any anonymous visitor may thus change records created by another visitor as well.
        • 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.
      • 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.
      • 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 edit form 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.
        • If “Show search results only” is checked, a value can be assigned and records can be deleted only if a search term or composed filter is entered, or if the view table displays data thanks to the filled-in values in the form that are referenced by the database query constraints.
    • 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.
      • 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.
      • 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.
        • 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.
        • 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.
      • To the list of marked records – primary key values (“id” column) separated by a semicolon – it is possible to access using variables “#datagrid1#”, “#datagrid2#”, “#datagrid3#” etc. in the script. The index indicates the order of the view table 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 in the edit form.
  • Show sums of column
    • 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.
  • Show only nested records
    • Checking this box determines whether the “PID = ID record in form” constraint should be automatically appended to the database query definition.
    • The condition does not take PFORM into account. If the source edit form stores nested records for several parent forms, a condition on PFORM has to be added to the database query. For a new record that has not been saved yet, the view table displays no records.
    • For efficient evaluation of this condition, the “PID” index should be set on the edit form used as the data source of the view table. The index is not set on the form that contains the view table. The “PFORM + PID” index starts with the “pform” column, so it does not speed up the condition on PID alone.
  • Hide data source
    • Checking this box determines whether the contents of the view table should be automatically hidden when the edit form is opened. Database records will not be displayed to the user until the “Show” icon is clicked or clicking on the tab in which the view table is located. If the view table is located on the tab that is active when the edit form is opened, the database records are displayed immediately.
  • Snap to previous control
    • Checking this box determines whether the control itself should be displayed to the right of the previous one in the edit form, or whether it will be displayed below the previous control in the usual way.

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 given in the separate guide Database query designer.
  • Hide data source
    • Checking this box determines whether the contents of the view table should be automatically hidden when the edit form is opened. Database records will not be displayed to the user until the “Show” icon is clicked or clicking on the tab in which the view table is located. If the view table is located on the tab that is active when the edit form is opened, the database records are displayed immediately.
  • Snap to previous control
    • Checking this box determines whether the control itself should be displayed to the right of the previous one in the edit form, or whether it will be displayed below the previous control in the usual way.

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.
      • 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 given in the separate guide Database query designer.
  • Hide data source
    • Checking this box determines whether the contents of the view table should be automatically hidden when the edit form is opened. Database records will not be displayed to the user until the “Show” icon is clicked or clicking on the tab in which the view table is located. If the view table is located on the tab that is active when the edit form is opened, the database records are displayed immediately.
  • Snap to previous control
    • Checking this box determines whether the control itself should be displayed to the right of the previous one in the edit form, or whether it will be displayed below the previous control in the usual way.

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; 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. The number of 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. 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.

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.
  • Show search results only
    • Checking this box determines whether the data in the view table should be displayed only when filling in the values in the form that are referenced by the database query constraints of that view table.
    • Searching regardless of diacritics is not set here, but on the individual controls using the “Search without diacritics” box.
    • Details
      • Conditions referring to a control of the form that is not filled in (for a ForeignKey control also the value 0) are omitted in this mode, so a single filled-in value is enough for the data to be displayed. In a group of conditions joined by “or”, however, such a condition lets all records through. The data is also displayed after a search term is entered. For an aggregate query, the box does not apply – the conditions are not omitted, they are evaluated in the same way as without the box checked, and the data is displayed immediately.
      • This box also determines where the term entered in the search box 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. “Help” tab

2.5.1. Help

  • Help text is displayed to the right of the control in the edit form.
  • The help texts of all controls start at the same vertical line across the entire edit form.
  • Text – the help text is defined by a manually entered text string in a multi-line text field below the radio button
  • From query – the help text is defined by the result of a database query that is evaluated when the edit form is opened
  • A detailed description of the help text is provided in the separate guide Layout settings.

2.6. “Rights” tab

2.6.1. Rights

  • Rights define a list of user groups and users who have permission to view the control on the edit form.

2.6.2. Replace rights to other controls

  • The “Replace rights to other controls” function is used to unify the rights within the entire edit form for controls that are related in terms of rights.
  • Thanks to the “Show...” link, it is possible to display a list of all controls in the edit form, including setting 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 edit form is to display the report available from the “Rights of child objects” tab in the edit form settings.

2.7. “Administration” tab

  • The “Administration” tab is only displayed for existing controls.

2.7.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 on the “General” tab. 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.7.2. Other

  • Change type to
    • The drop-down list offers the types of controls to which conversion of the control is supported.

2.8. “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.
    • 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; the values selected in the column filters are deleted.
    • 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
    • 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. 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.
  • “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.
  • 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.
    • 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; 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. 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.
  • 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.
  • 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. A detailed description of the syntax of column names is provided in the separate guide Database query designer.
  • Details
    • For a statistical view table, the “Default sort” button also resets the number of rows per page to the default of 20 and returns to the first page.
    • 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; 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 ...”.
    • 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.

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 the Ctrl+Enter keyboard shortcut behaves in the same way as with the details panel.
  • “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.
    • 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 the columns; the columns only if the “Deny customization” box is not checked.
  • 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.
    • 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 the details panel and in the tooltip.

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

  • The details panel behaves in the same way as in a view table on a view page. A detailed description is provided in the separate guide View page – DataGrid.

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#