On cut paste Blank cell should be highlighted with red circle

Posted by: Shalini89garg on 30 April 2018, 8:43 pm EST

    • Post Options:
    • Link

    Posted 30 April 2018, 8:43 pm EST

    Hi,

    Can anyone please help on below issue, when i am doing cut paste, its making cell as blank ,so my requirements is as soon as I do cut paste ,blank cell should be highlighted with red circle . and sheet.isValid(row, col, cellValue) should be false.

  • Posted 30 April 2018, 8:44 pm EST

  • Posted 2 May 2018, 10:42 pm EST

    Hello,

    You can create a DataValidator for cells to highlight the cell with red circle for blank values. Then you can again set the validation in ClipboardChanging event:

    You can use the code similar to below:

    
      activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
                    var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition);
                    nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.notEqualsTo);
                    nCondition.expected("");
                    //  nCondition.treatNullValueAsZero(false);
                    var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition);
                    validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom);
                    validator.ignoreBlank(false);
                    activeSheet.getCell(-1, -1, GC.Spread.Sheets.SheetArea.viewport).validator(validator);
                    spread.options.highlightInvalidData = true;
                    spread.refresh();
                });
    
    

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels