[Data Grid] Freeze the first 3 column

Forge Component
(31)
Published on 6 Nov (5 days ago) by OutSystems R&D
31 votes
Published on 6 Nov (5 days ago) by OutSystems R&D

How can I freeze the first three columns without right-clicking and input the number of columns i want to freeze?

You can fix it by writing script in Expession under Grid Widjet.

<script>

var gObj =GridOS.ComponentUtils.getGridObjectById("+ Grid.Id +");
gObj.columns.frozenColumns = 3;
gObj.grid.frozenColumns = 3;
</script>


Try it.

I'm sorry.
As there was a mistake, I correct it.

"<script>

var gObj =GridOS.ComponentUtils.getGridObjectById(" + Grid.Id + ");
gObj.columns.frozenColumns = 3;
gObj.grid.frozenColumns = 3;
</script>"


The proper way to do this is passing the wijmo parameter and parameter value to the the OS grid's AdvancedFormat property.

  Property:  AdvancedFeatures

  Value: "frozenColumns: 2"

However this does not work due to OS's datagrid's wrapper frozenColumns property implementation.  I filed a support ticket with OutSystems to respect the frozenColumns passed in parameter value.

Until its fixed, use Takahisa workaround for this and other non respected wijmo properties.