LiveCode LessonsHow to - LiveCode Marketplace Products Data Grid HelperHow Do I Change the Default Header Behavior of a DataGrid?

How Do I Change the Default Header Behavior of a DataGrid?

This lesson describes, how to change the Default Header Behavior of a Datagrid, using the Data Grid Helper plugin.

Opening "Behaviors / Templates" topic

Opening "Behaviors / Templates" topic

Once DGH opened by double-clicking on a DataGrid, go in the "Behaviors / Templates" topic.

Adding a New Button

Adding a New Button

Add a new button in your project. This button will received the behavior script for the header.

Opening the DGH's Behavior Picker

Opening the DGH's Behavior Picker

Click on the 3 dots button (1), for opening the DGH's Behavior Picker, then click on the "Create" button (2).

Moving the Mouse Pointer Over the New Button

Moving the Mouse Pointer Over the New Button

We can now move the mouse pointer over the new button. DGH's Behavior Picker displays an information window with the steps for choosing this button as a behavior for our datagrid header. (1)

At any time you can discard the selection by clicking on the Behavior Picker's cancel button. (2)

Selecting the Behavior Button

Selecting the Behavior Button

Just click on the button, for selecting it.

In the Behavior Picker window, the "Cancel" button changes for a "Confirm" label.

Validating the Button Selection

Validating the Button Selection

For confirming the button as a default header behavior, click on the "Confirm" button in the DGH's Behavior Picker.

A reference to the button will be added in the Default Header Behavior property value.

Editing the Default Header Behavior Script

Editing the Default Header Behavior Script

For editing the Header Behavior Script and define the Header Behavior, you need for your project:

- open the button's script (1)

- or click on the Behavior Picker's Edit button (2)

The default script installed by DGH is the default script for the Header Behavior included in the Datagird Library.

Installing Ready to Use Header Behavior Script

Installing Ready to Use Header Behavior Script

If you have no idea how to change the Behavior Script, DGH comes in it's current version (actually 1.6), with 4 ready to use scripts:

1. Reorder columns. This header script allows to rearange columns order by a drag & drop

2. Resize columns by double click: double click on a column separator for resizing the column width, depending of the max length of it's content.

3. Select column: gives the possibility to "hilite" a column (header and content) by clicking on it's header

4. Column label unicode encoding: by installing this script, the column header labels becomes unicode chars capable.

0 Comments

Add your comment

E-Mail me when someone replies to this comment