Cell Conditional Format

Posted by: hoang.nguyen on 22 November 2017, 3:49 am EST

    • Post Options:
    • Link

    Posted 22 November 2017, 3:49 am EST

    A while back I have post a question about conditional format on cells. What I am trying to achieve is, if cell value is equal to zero, then make font color matching current cell background thus it look like the cell is empty. Since I use [autoGenerateColumns]=“true” and I was told to use:

    for (let c = 0; c < flex.columnflex.length; c++) {

    flex.columns[c].isRequired = false;

    for (let r = 0; r < flex.rowflex.length; r++) {
          if (flex.getCellData(r, c, false) === 0) {
            flex.setCellData(r, c, null, false, false);
          }
    }
    

    }

    this works great except is the entire column is null, thus that column is also unloaded from the flexgrid, meaning instead of 52 columns grid, it it now 51. Is the a way I can keep the above conditional format method and keep the column or there is another way just to change the font color to match current cell background, That means the column will remain in the grid. I am having some coding issue because of missing column. Thank yo very much.

  • Posted 22 November 2017, 11:08 pm EST

    Hi Hoang,

    We tried to set null value for a column by setting autoGenerateColumns to true and isRequired to false. The column remains in the FlexGrid, it does not get removed from FlexGrid.

    For your reference, please refer to the attached sample for the same.

    If the issue persists, please modify the attached sample.

    ~Manish

    FlexGrid-itemFormatter-cellRange-color.zip

  • Posted 28 November 2017, 7:48 am EST

    Thank you Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels