How Do My DataGrid Can Support UTF-8 or Unicode By Using DGH?
This lesson describes, how to change the Default Column Behavior of a Datagrid, for having it supporting UTF-8 or Unicode
Add a new button in your project. This button will received the behavior script for the header.
Name this button "Column Behavior"
Once DGH opened by double-clicking on a DataGrid, go in the "Behaviors / Templates" topic.
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 columns. (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 Column Behavior property value.
Our Datagrid is now ready to receive a column behavior script.
Go in the DGH's scripts topic and click on the "Install Script" button of the "Column Encoding Behavior" line.
We have now to change the properties of each column which we want in UTF-8 or Unicode.
The DGH's columns builder can help by doing that for us.
Open the DGH's columns topic and click on the Edit button for opening "Columns Builder"
In Columns Builder
1. Open the Cell Content topic
2. Select the column you want in UTF-8 or Unicode, by clicking on its header
3. Change the Text Displayed property for UTF-8 (or Unicode)
Change the Text Displayed property for UTF-8 (or Unicode)
Note, both Text Displayed and Text Edited are not natives properties of the DataGrid API. These properties are managed by DGH only. However, you can still change them by code, even if DGH is not opened.
Apply the changes to the selected Datagrid by clicking on the "Apply" button