Good Afternoon,
I have a Igx-Grid that is using both the Igx State Directive and has Conditional Cell Styling attached to the Columns. The issue I am running into when trying to use both is when I load up the Columns that I have saved off to a service back up, the Conditional Cell Styling is not being applied. From what I can tell looking at the JSON of the Grid Columns being captured by the State Directive, is that it does not appear to be grabbing the cellStyle part of the column, which I believe is causing the issue with the conditional styling not being applied appropriately.
For the time being, I found a work around which is to manually assign each column a '_cellStyles' property equal to the conditional cell style object I am using something like so:
for(let i=0; i<this.gridView.columns.length; ++i){
if(this.gridView.columns[i].['_cellStyles'] === null){
this.gridView.columns[i].['_cellStyles'] = this.styles;
}
Not sure if this is a bug, oversight, or intentional. For the time being the work around works as long as I can keep dynamically assigning conditional cell styling, it should not be an issue for me, but figured I would check to make sure.
-Randall
Hi Randall,
Yes, you can add cell styles in the initColumns.
Here is a link how to set and use the cellStyles:
https://es.infragistics.com//angularsite/components/grid/conditional_cell_styling.html#using-cellstyles
Nevermind, apparently I completely missed the limitations section on this, my apologies. Is the way I am setting cellStyles above, the correct way to do in initColumns? Or is there a better way to do it?