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.
Once DGH opened by double-clicking on a DataGrid, go in the "Behaviors / Templates" topic.
Add a new button in your project. This button will received the behavior script for the header.
Click on the 3 dots button (1), for opening the DGH's Behavior Picker, then click on the "Create" button (2).
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)
Just click on the button, for selecting it.
In the Behavior Picker window, the "Cancel" button changes for a "Confirm" label.
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.
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.
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.