Hi,
Could you please tell how to update an unbound column ? I've seen that with the 2016.1 version, there is method called 'setUnboundValueByPK' but i'm on the 2015.1 version and there is no indication in the documentation for that method. I guess its because its not available.
What could be your workaround for that ?
Regards
Hello Steeve,
To update unbound column, you have to use formula. Code Snippet:
columns: [{ headerText: "Total Price", key: "Total", dataType: "number", unbound: true, format: "currency", formula: function CalculateTotal(data, grid) { return data["UnitPrice"] * data["UnitsInStock"]; } }]
You can refer the following sample demonstrates how to add and configure unbound columns in igGrid
http://www.igniteui.com/grid/unbound-column
We do have setUnboundValues method in 15.1. setUnboundValues property sets unbound values for the unbound column with the specified key
http://www.igniteui.com/help/iggrid-unboundcolumns-method-reference
Please note setUnboundValueByPK property is not available in 15.1 but available in 15.2. All the method references available for unbound column iggrid is :
http://www.igniteui.com/help/api/2015.1/ui.iggrid#methods:setUnboundValues
Please let me know if I can assist you further.
Thank you for your answer.
Here is my context:
I have a unbound grid column set with a template property that displays an icon. I want to change the icon when the user clicks on the cell. The value of the icon does not depend on a value in the datasource, it depends more on an interaction with the user.
maybe i can't do that with an unbound column ?
What i've done so far is that i've added to all my objects in my datasource a new property with a value representing an icon, removed the unbound property of the cell and when the user clicks on the cell i call for an 'setCellValue' and update the icon. but i was hoping not to have things like that as i don't want to alter my datasource with that kind of property.
In the documentation , it says that with the method 'setCellValue' i should be able to update an unbound column. but i don't know how to do that as it does not rely on a specific value. Could you please help with that ?
In advance thank you for your help